CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Class:      EcalTPGAnalyzer
00004 // 
00005 //
00006 // Original Author:  Pascal Paganini
00007 //
00008 
00009 #include "FWCore/Framework/interface/EDAnalyzer.h"
00010 #include "FWCore/Framework/interface/Event.h"
00011 #include "FWCore/Framework/interface/MakerMacros.h"
00012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00013 #include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h"
00014 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00015 #include <vector>
00016 #include <string>
00017 #include <TFile.h>
00018 #include <TTree.h>
00019 
00020 class CaloSubdetectorGeometry ;
00021 
00022 
00023 // Auxiliary class
00024 class towerEner {   
00025  public:
00026   float eRec_ ;
00027   int tpgEmul_[5] ;
00028   int tpgADC_; 
00029   int iphi_, ieta_, nbXtal_ ;
00030   towerEner()
00031     : eRec_(0), tpgADC_(0),  
00032       iphi_(-999), ieta_(-999), nbXtal_(0)
00033   { 
00034     for (int i=0 ; i<5 ; i ++) tpgEmul_[i] = 0 ; 
00035   }
00036 };
00037 
00038 
00039 class EcalTPGAnalyzer : public edm::EDAnalyzer {
00040 public:
00041   explicit EcalTPGAnalyzer(const edm::ParameterSet&);
00042   ~EcalTPGAnalyzer();  
00043   virtual void analyze(edm::Event const &, edm::EventSetup const &);
00044   virtual void beginRun(edm::Run const &, edm::EventSetup const &) ;
00045   
00046 private:
00047   struct EcalTPGVariables
00048   {
00049     // event variables
00050     unsigned int runNb ;
00051     unsigned int evtNb ;
00052     unsigned int bxNb ;
00053     unsigned int orbitNb ;
00054     unsigned int nbOfActiveTriggers ;
00055     int activeTriggers[128] ;
00056 
00057     // tower variables
00058     unsigned int nbOfTowers ; //max 4032 EB+EE
00059     int ieta[4032] ;
00060     int iphi[4032] ;
00061     int nbOfXtals[4032] ;
00062     int rawTPData[4032] ;
00063     int rawTPEmul1[4032] ;
00064     int rawTPEmul2[4032] ;
00065     int rawTPEmul3[4032] ;
00066     int rawTPEmul4[4032] ;
00067     int rawTPEmul5[4032] ;
00068     float eRec[4032] ;
00069   } ;
00070 
00071 private:
00072   TFile * file_;
00073   TTree * tree_ ;
00074   EcalTPGVariables treeVariables_ ;
00075 
00076   edm::InputTag tpCollection_ ;
00077   edm::InputTag tpEmulatorCollection_ ;
00078   edm::InputTag digiCollectionEB_ ;
00079   edm::InputTag digiCollectionEE_ ;
00080   std::string gtRecordCollectionTag_ ;
00081 
00082   bool allowTP_ ;
00083   bool useEE_ ;
00084   bool print_ ;
00085 
00086   const CaloSubdetectorGeometry * theEndcapGeometry_ ;
00087   const CaloSubdetectorGeometry * theBarrelGeometry_ ;
00088   edm::ESHandle<EcalTrigTowerConstituentsMap> eTTmap_;
00089 
00090 
00091 };
00092