////////////////////////////////////////////////////////// // This class has been automatically generated // (Fri Sep 8 15:44:15 2000 by ROOT version2.24/04) // from TTree STNTUPLE/STNTUPLE // found on file: muoval.root ////////////////////////////////////////////////////////// #ifndef DataVal_h #define DataVal_h #if !defined(__CINT__) || defined(__MAKECINT__) #include #include #include #include #include #include #include #include #include #include #include #include #include #endif struct CalHistograms_t { TH1F* fNTowers; TH1F* fNTow1; TH1F* fEmPmt; TH1F* fHadPmt; TH2F* fEmEtaPhi [2]; TH2F* fHadEtaPhi[2]; TH1F* fSumEt; TH1F* fTowerEt; TH2F* fMyronVsSumEt; }; struct L1Histograms_t { TH1F* fNBits; // after prescale TH1F* fUnprescaledBits; TH1F* fPrescaledBits; TH1F* fMyronFlag; TH1F* fBunchCounter; TH1F* fCalibType; TH1F* fAbortMarker; TH1F* fB0Marker; TH1F* fBCMarker; }; struct JetCluHistograms_t { TH1F* fNJets; TH1F* fJetEt; TH1F* fJetEta; TH1F* fJetPhi; TH1F* fSeedEt; }; struct VertexHistograms_t { TH1F* fN; TH1F* fZ; TH1F* fNTracks; TH1F* fCharge; }; class DataVal { public: TTree *fTree; // pointer to the analyzed TTree or TChain Int_t fCurrent; // current Tree number in a TChain // Declaration of leaves types TCalDataBlock* fCalData; TClcDataBlock* fClcData; TCmuDataBlock* fCmuData; TCmxDataBlock* fCmxData; TStnHeaderBlock* fEventHeader; TStnJetBlock* fJetClu; TStnTriggerBlock* fTriggerBlock; TClonesArray* fVertex; // List of branches (of interest) TBranch *b_CalData; TBranch *b_ClcData; TBranch *b_CmuData; TBranch *b_CmxData; TBranch *b_JetClu; TBranch *b_EventHeader; TBranch *b_Vertex; TBranch *b_Trigger; //----------------------------------------------------------------------------- // histograms: CAL //----------------------------------------------------------------------------- CalHistograms_t fHCal; ClcHistograms_t fHClc; Clc1Histograms_t fHClc1; L1Histograms_t fHL1; VertexHistograms_t fHVertex; JetCluHistograms_t fHJetClu; TH1F* fTmpHist1; //----------------------------------------------------------------------------- // methods //----------------------------------------------------------------------------- DataVal(const char* filename=0); ~DataVal(); Int_t Cut(Int_t entry); Int_t GetEntry(Int_t entry); Int_t LoadTree(Int_t entry); void Init(TTree *tree); // number of events to process void Cmu(int nev=0); void Cmx(int nev=0); void Cal(int nev=0, int adc_threshold=60); void Vertex(int nev=0, int myron_flag=-1); void Level1(int nev=0); void JetClu(int nev=0); void PlotCalEmChannel (int ieta, int iphi, int channel); void PlotCalHadChannel(int ieta, int iphi, int channel); void Notify(); void Show(Int_t entry = -1); }; #endif #ifdef DataVal_cxx //_____________________________________________________________________________ DataVal::DataVal(const char* filename) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. TTree* tree; TFile* f = 0; if (filename != 0) { TSeqCollection* list = gROOT->GetListOfFiles(); if (list) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(filename); } if (!f) { f = new TFile(filename); } } tree = (TTree*) f->Get("STNTUPLE"); Init(tree); // set histogram pointers to 0 fHCal.fNTowers = 0; fHCal.fNTow1 = 0; fHCal.fEmPmt = 0; fHCal.fHadPmt = 0; fHCal.fEmEtaPhi [0] = 0; fHCal.fEmEtaPhi [1] = 0; fHCal.fHadEtaPhi[0] = 0; fHCal.fHadEtaPhi[1] = 0; fHCal.fSumEt = 0; fHCal.fMyronVsSumEt = 0; fHCal.fTowerEt = 0; fHL1.fNBits = 0; fHL1.fUnprescaledBits = 0; fHL1.fPrescaledBits = 0; fHL1.fMyronFlag = 0; fHL1.fBunchCounter = 0; fHL1.fCalibType = 0; fHL1.fAbortMarker = 0; fHL1.fB0Marker = 0; fHL1.fBCMarker = 0; fHJetClu.fNJets = 0; fHJetClu.fJetEt = 0; fHJetClu.fJetEta = 0; fHJetClu.fJetPhi = 0; fHJetClu.fSeedEt = 0; fHClc.fNAdcHits = 0; fHClc.fNTdcHits = 0; fHClc.fNTdcHits1 = 0; fHClc.fNTdcHitsCh = 0; for (int i=0; i<96; i++) { fHClc.fAdc [i] = 0; fHClc.fAdc1[i] = 0; fHClc.fTdc0[i] = 0; fHClc.fTdc [i] = 0; fHClc.fTdc1[i] = 0; fHClc.fTdc2[i] = 0; fHClc.fTdc3[i] = 0; fHClc.fWid [i] = 0; fHClc.fDeltaTdc [i] = 0; fHClc.fDeltaTdc1[i] = 0; fHClc.fDeltaWid [i] = 0; fHClc.fDeltaWid1[i] = 0; } for (int i=0; i<2; i++) { fHClc.fNHitsModule [i] = 0; fHClc.fNHitChModule[i] = 0; fHClc.fModuleTime [i] = 0; for (int j=0; j<3; j++) { fHClc.fLayerTime[i][j] = 0; fHClc.fNHitsLayer[i][j] = 0; fHClc.fNHitChLayer[i][j] = 0; } } fHClc.fModuleDeltaT = 0; fHClc.fModuleZ = 0; fHClc.fDeltaZ = 0; fHClc.fDeltaZ5 = 0; fHClc.fZClcVsZCot = 0; for (int i=0; i<3; i++) { fHClc.fLayerDeltaT[i] = 0; fHClc.fLayerZ [i] = 0; } fHClc.fNHitsM01 = 0; fHClc.fNHitChM01 = 0; fHClc.fMyronVsTdc = 0; fHClc.fTdc35VsTdc82 = 0; fHClc.fMyronVsTdc35 = 0; fHClc.fMyronVsAdcCounts = 0; fHClc.fFitT0 = 0; fHClc.fFitSigma = 0; fHClc.fFitChi2 = 0; fHClc.fFitDeltaTdc1 = 0; fHClc.fFitDeltaTdc2 = 0; //----------------------------------------------------------------------------- // CLC1 histograms //----------------------------------------------------------------------------- for (int i=0; i<96; i++) { fHClc1.fWidthVsTime [i] = 0; fHClc1.fDtVsT2 [i] = 0; fHClc1.fWidthVsTimeProf[i] = 0; } //----------------------------------------------------------------------------- // VERTEX histograms //----------------------------------------------------------------------------- fHVertex.fN = 0; fHVertex.fZ = 0; fHVertex.fNTracks = 0; fHVertex.fCharge = 0; //----------------------------------------------------------------------------- // tmp histograms //----------------------------------------------------------------------------- fTmpHist1 = 0; } //_____________________________________________________________________________ DataVal::~DataVal() { if (!fTree) return; delete fTree->GetCurrentFile(); } //_____________________________________________________________________________ Int_t DataVal::GetEntry(Int_t entry) { // Read contents of entry. if (!fTree) return 0; return fTree->GetEntry(entry); } //_____________________________________________________________________________ Int_t DataVal::LoadTree(Int_t entry) { // Set the environment to read one entry if (!fTree) return -5; Int_t centry = fTree->LoadTree(entry); if (centry < 0) return centry; if (fTree->IsA() != TChain::Class()) return centry; TChain *chain = (TChain*)fTree; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } //_____________________________________________________________________________ void DataVal::Init(TTree *tree) { // Set branch addresses if (tree == 0) return; fTree = tree; fCurrent = -1; fTree->SetBranchAddress("CalDataBlock" ,&fCalData); fTree->SetBranchAddress("ClcDataBlock" ,&fClcData); fTree->SetBranchAddress("CmuDataBlock" ,&fCmuData); fTree->SetBranchAddress("CmxDataBlock" ,&fCmxData); fTree->SetBranchAddress("JetBlock" ,&fJetClu); fTree->SetBranchAddress("HeaderBlock" ,&fEventHeader); fTree->SetBranchAddress("VertexBlock" ,&fVertex); fTree->SetBranchAddress("TriggerBlock" ,&fTriggerBlock); Notify(); } //_____________________________________________________________________________ void DataVal::Notify() { // called by LoadTree when loading a new file // get branch pointers b_CalData = fTree->GetBranch("CalDataBlock"); b_ClcData = fTree->GetBranch("ClcDataBlock"); b_CmuData = fTree->GetBranch("CmuDataBlock"); b_CmxData = fTree->GetBranch("CmxDataBlock"); b_JetClu = fTree->GetBranch("JetBlock"); b_EventHeader = fTree->GetBranch("HeaderBlock"); b_Vertex = fTree->GetBranch("VertexBlock"); b_Trigger = fTree->GetBranch("TriggerBlock"); } //_____________________________________________________________________________ void DataVal::Show(Int_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fTree) return; fTree->Show(entry); } //_____________________________________________________________________________ Int_t DataVal::Cut(Int_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef DataVal_cxx