// DragonSelector.h // author JEP. // brief DragonSelector::MakeSelector() class. // version 1.1. // date Nov 2004. // ////////////////////////////////////////////////////////// // This class has been automatically generated on // Wed Nov 24 13:42:22 2004 by ROOT version 4.00/08 // from TTree dragonTree/dragonTree ////////////////////////////////////////////////////////// #ifndef DragonSelector_h #define DragonSelector_h #include #include #include #include #include #include #include "TDataItem.h" #include "TGrDetector.h" #include "THiDetector.h" #include "TDragonEvent.h" #include "TScalerEvent.h" #include "TEpicsEvent.h" /// The number of scalers to expect. /// static const Int_t scalerN = 24; static const Int_t epicsN = 74; class DragonSelector : public TSelector { public: DragonSelector(TTree * = 0); ~DragonSelector(); Int_t Version() const; void Begin(TTree *); void SlaveBegin(TTree *); void Init(TTree *); Bool_t Notify(); Bool_t Process(Long64_t); void SetHistograms(); void SetDetectors(); void SetCuts(); void SetOption(const char *); void SetObject(TObject *); void SetInputList(TList *); TList *GetOutputList() const; void SlaveTerminate(); void Terminate(); /// Pointer to the analyzed TTree or TChain. /// TTree *fChain; //! /// DragonEvent leaf pointer. /// TDragonEvent *fDragonEvent; /// ScalerEvent leaf pointer. /// TScalerEvent *fScalerEvent; /// EpicsEvent leaf pointer. /// TEpicsEvent *fEpicsEvent; /// DragonEvent branch. /// TBranch *b_fDragonEvent; //! /// ScalerEvent branch. /// TBranch *b_fScalerEvent; //! /// ScalerEvent branch. /// TBranch *b_fEpicsEvent; //! private: /// A vector containing heavy-ion detectors. /// vector fDetsH; /// A vector containing gamma-ray detectors. /// vector fDetsG; /// A utility iterator for the BGO detectors. /// vector::iterator fBgoLast; /// A folder to put the spectra in. /// TFolder *fHistFolder; /// Scaler spectra. /// TH1F *hScaler[scalerN]; /// Epics Spectra /// TH1F *hEpics[epicsN]; /// BGO singles highest-energy spectrum. /// TH2F *hsBgoE0; /// BGO singles hit-pattern for highest-energy hit. /// TH1F *hsBgo0; /// BGO singles energy spectrum. /// TH2F *hsBgoE; /// BGO singles highest and second highest energies. /// TH2F *hsBgoE0BgoE1; /// BGO singles RF tdc value. /// TH1F *hsBgoRf0; /// BGO coincidences highest-energy spectrum. /// TH2F *hcBgoE0; /// BGO coincidences energy spectrum. /// TH2F *hcBgoE; /// BGO coincidences hit-pattern for highest energy hit. /// TH1F *hcBgo0; /// BGO coincidences highest and second highest energies. /// TH2F *hcBgoE0BgoE1; /// IC singles adc chan v energy. /// TH2F *hsIcE; /// IC singles de v e. /// TH2F *hsIcEdE; /// IC singles energy sum. /// TH1F *hsIcSum; /// IC coincidences adc chan v energy. /// TH2F *hcIcE; /// IC coincidences energy sum. /// TH1F *hcIcSum; /// IC coincidences de v e. /// TH2F *hcIcEdE; /// IC coincidences de v e within time of flight window. /// TH2F *hcIcEdEtof; /// IC energy v MCP TAC time. /// TH2F *hcIcEMcpT; /// MCP time vs energy. /// TH1F *hsMcpT; /// SB singles energy spectrum. /// TH2F *hsSbE; /// SB singles energy spectrum for 1 min of runtime /// TH2F *hsSbE2min; /// SB singles energy v rf. /// TH2F *hsSbERf; /// IC energy v MCP TAC time. /// TH2F *hsIcEMcpT; /// Gas-target position spectrum. /// TH1F *hcTargZ0; /// Coincident times-of-flight. /// TH2F *hcGrTofHiTof; /// A silly cut on the BGO spectrum. /// TCutG *fBgoCut; /// The x-bin for the scaler data. /// ULong_t fScalerBinX; ULong_t fEpicsBinX; // Stores how many processes have been made. ULong_t fProcessNum; Float_t eventTof; TH1F *channelHist; Float_t icPlate1E; Float_t icPlate2E; Float_t tac; Float_t BGOEnergies[30]; Float_t BGOVector[30][3]; TTree *eventTree; Int_t nCoincident; Int_t nMCP; Int_t nIC; Int_t nGamma; Float_t SeventTof; TH1F *SchannelHist; TH2F *S2channelHist; Float_t SicPlate1E; Float_t SicPlate2E; Float_t Stac; Float_t SrfH; Float_t SrfG; Float_t SBGOEnergies[30]; Float_t SBGOVector[30][3]; TTree *GammaSinglesTree; TTree *IcSinglesTree; ClassDef(DragonSelector, 0); }; #endif #ifdef DragonSelector_cxx DragonSelector::DragonSelector(TTree *) { /// Default constructor. /// } DragonSelector::~DragonSelector() { /// Default destructor. /// // Need to properly delete the detectors added, as otherwise // pointers are cleared but not what they point at. for (UInt_t i = 0; i < fDetsH.size(); i++) delete fDetsH[i]; for (UInt_t i = 0; i < fDetsG.size(); i++) delete fDetsG[i]; delete fBgoCut; fHistFolder->Clear(); gROOT->GetRootFolder()->Remove(fHistFolder); gROOT->GetListOfBrowsables()->Remove(fHistFolder); } inline Int_t DragonSelector::Version() const { /// Automatically generated ROOT method from MakeSelector. /// return 1; } inline void DragonSelector::SetOption(const char *option) { /// Automatically generated ROOT method from MakeSelector. /// fOption = option; } inline void DragonSelector::SetObject(TObject *obj) { /// Automatically generated ROOT method from MakeSelector. /// fObject = obj; } inline void DragonSelector::SetInputList(TList *input) { /// Automatically generated ROOT method from MakeSelector. /// fInput = input; } inline TList * DragonSelector::GetOutputList() const { /// Automatically generated ROOT method from MakeSelector. /// return fOutput; } void DragonSelector::Init(TTree *tree) { /// The Init() function is called when the selector needs to initialize /// a new tree or chain. Typically here the branch addresses of the tree /// will be set. It is normaly not necessary to make changes to the /// generated code, but the routine can be extended by the user if needed. /// Init() will be called many times when running with PROOF. /// // Set object pointers. fDragonEvent = 0; fScalerEvent = 0; fEpicsEvent = 0; // Set branch addresses. if (tree == 0) return; fChain = tree; fChain->SetBranchAddress("fDragonEvent", &fDragonEvent); fChain->SetBranchAddress("fScalerEvent", &fScalerEvent); fChain->SetBranchAddress("fEpicsEvent", &fEpicsEvent); // Set any other members. fScalerBinX = 0; fEpicsBinX = 0; } Bool_t DragonSelector::Notify() { /// The Notify() function is called when a new file is opened. This /// can be either for a new TTree in a TChain or when when a new TTree /// is started when using PROOF. Typically here the branch pointers /// will be retrieved. It is normaly not necessary to make changes /// to the generated code, but the routine can be extended by the /// user if needed. /// // Get branch pointers. b_fDragonEvent = fChain->GetBranch("fDragonEvent"); b_fScalerEvent = fChain->GetBranch("fScalerEvent"); b_fEpicsEvent = fChain->GetBranch("fEpicsEvent"); return kTRUE; } #endif // #ifdef DragonSelector_cxx