59 allowTP_ = iConfig.
getParameter<
bool>(
"ReadTriggerPrimitives");
64 file_ =
new TFile(
"ECALTPGtree.root",
"RECREATE");
68 tree_ =
new TTree(
"EcalTPGAnalysis",
"EcalTPGAnalysis" );
70 tree_->Branch(
"runNb",&treeVariables_.runNb,
"runNb/i");
71 tree_->Branch(
"evtNb",&treeVariables_.evtNb,
"evtNb/i");
72 tree_->Branch(
"bxNb",&treeVariables_.bxNb,
"bxNb/i");
73 tree_->Branch(
"orbitNb",&treeVariables_.orbitNb,
"orbitNb/i");
74 tree_->Branch(
"nbOfActiveTriggers",&treeVariables_.nbOfActiveTriggers,
"nbOfActiveTriggers/i");
75 tree_->Branch(
"activeTriggers",treeVariables_.activeTriggers,
"activeTriggers[nbOfActiveTriggers]/I");
77 tree_->Branch(
"nbOfTowers",&treeVariables_.nbOfTowers,
"nbOfTowers/i");
78 tree_->Branch(
"ieta", treeVariables_.ieta,
"ieta[nbOfTowers]/I");
79 tree_->Branch(
"iphi", treeVariables_.iphi,
"iphi[nbOfTowers]/I");
80 tree_->Branch(
"nbOfXtals", treeVariables_.nbOfXtals,
"nbOfXtals[nbOfTowers]/I");
81 tree_->Branch(
"rawTPData", treeVariables_.rawTPData,
"rawTPData[nbOfTowers]/I");
82 tree_->Branch(
"rawTPEmul1", treeVariables_.rawTPEmul1,
"rawTPEmul1[nbOfTowers]/I");
83 tree_->Branch(
"rawTPEmul2", treeVariables_.rawTPEmul2,
"rawTPEmul2[nbOfTowers]/I");
84 tree_->Branch(
"rawTPEmul3", treeVariables_.rawTPEmul3,
"rawTPEmul3[nbOfTowers]/I");
85 tree_->Branch(
"rawTPEmul4", treeVariables_.rawTPEmul4,
"rawTPEmul4[nbOfTowers]/I");
86 tree_->Branch(
"rawTPEmul5", treeVariables_.rawTPEmul5,
"rawTPEmul5[nbOfTowers]/I");
87 tree_->Branch(
"eRec", treeVariables_.eRec,
"eRec[nbOfTowers]/F");
109 theEndcapGeometry_ = &(*theEndcapGeometry_handle);
110 theBarrelGeometry_ = &(*theBarrelGeometry_handle);
124 map<EcalTrigTowerDetId, towerEner> mapTower ;
125 map<EcalTrigTowerDetId, towerEner>::iterator itTT ;
133 treeVariables_.runNb = iEvent.
id().
run() ;
134 treeVariables_.evtNb = iEvent.
id().
event() ;
154 treeVariables_.nbOfActiveTriggers = 0 ;
155 for (std::vector<bool>::iterator itBit = dWord.begin(); itBit != dWord.end(); ++itBit) {
157 int maskBit = triggerMaskAlgoTrig[iBit] & (1 << iDaq);
158 if (maskBit) *itBit =
false;
160 treeVariables_.activeTriggers[treeVariables_.nbOfActiveTriggers] = iBit ;
161 treeVariables_.nbOfActiveTriggers++ ;
184 mapTower[TPtowid] = tE ;
194 iEvent.
getByLabel(tpEmulatorCollection_, tpEmul);
200 itTT = mapTower.find(TPtowid) ;
201 if (itTT != mapTower.end())
202 for (
int j=0 ; j<5 ; j++) (itTT->second).tpgEmul_[j] = d[j].raw() ;
219 itTT = mapTower.find(towid) ;
220 if (itTT != mapTower.end()) (itTT->second).nbXtal_++ ;
231 itTT = mapTower.find(towid) ;
232 if (itTT != mapTower.end()) (itTT->second).nbXtal_++ ;
250 treeVariables_.nbOfTowers = mapTower.size() ;
252 for (itTT = mapTower.begin() ; itTT != mapTower.end() ; ++itTT) {
253 treeVariables_.
ieta[towerNb] = (itTT->second).ieta_ ;
254 treeVariables_.iphi[towerNb] = (itTT->second).iphi_ ;
255 treeVariables_.nbOfXtals[towerNb] = (itTT->second).nbXtal_ ;
256 treeVariables_.rawTPData[towerNb] = (itTT->second).tpgADC_ ;
257 treeVariables_.rawTPEmul1[towerNb] = (itTT->second).tpgEmul_[0] ;
258 treeVariables_.rawTPEmul2[towerNb] = (itTT->second).tpgEmul_[1] ;
259 treeVariables_.rawTPEmul3[towerNb] = (itTT->second).tpgEmul_[2] ;
260 treeVariables_.rawTPEmul4[towerNb] = (itTT->second).tpgEmul_[3] ;
261 treeVariables_.rawTPEmul5[towerNb] = (itTT->second).tpgEmul_[4] ;
262 treeVariables_.eRec[towerNb] = (itTT->second).eRec_ ;
T getParameter(std::string const &) const
EventNumber_t event() const
int bunchCrossing() const
~EcalTPGAnalyzer() override
int ieta() const
get the tower ieta
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< bool > DecisionWord
typedefs
void analyze(edm::Event const &, edm::EventSetup const &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const DecisionWord & decisionWord(int bxInEventValue) const
int iphi() const
get the tower iphi
const EcalTrigTowerDetId & id() const
T const * product() const
T const * product() const
EcalTPGAnalyzer(const edm::ParameterSet &)