78 edm::LogInfo(
"AnalyzerMB") <<
"Use Time cut of " << timeCut_
90 myTree_ =
new TTree(
"SimJet",
"SimJet Tree");
91 myTree_->Branch(
"mydet", &
mydet,
"mydet/I");
92 myTree_->Branch(
"mysubd", &
mysubd,
"mysubd/I");
93 myTree_->Branch(
"cells", &
cells,
"cells");
94 myTree_->Branch(
"depth", &
depth,
"depth/I");
95 myTree_->Branch(
"ieta", &
ieta,
"ieta/I");
96 myTree_->Branch(
"iphi", &
iphi,
"iphi/I");
97 myTree_->Branch(
"mom0_MB", &
mom0_MB,
"mom0_MB/F");
98 myTree_->Branch(
"mom1_MB", &
mom1_MB,
"mom1_MB/F");
99 myTree_->Branch(
"mom2_MB", &
mom2_MB,
"mom2_MB/F");
100 myTree_->Branch(
"mom3_MB", &
mom2_MB,
"mom3_MB/F");
101 myTree_->Branch(
"mom4_MB", &
mom4_MB,
"mom4_MB/F");
111 for (std::map<HcalDetId,myInfo>::const_iterator itr=
myMap_.begin();
112 itr !=
myMap_.end(); ++itr) {
113 mysubd = itr->first.subdet();
114 depth = itr->first.depth();
115 iphi = itr->first.iphi();
116 ieta = itr->first.ieta();
149 edm::LogInfo(
"AnalyzerMB") <<
" Start SimAnalyzerMinbias::analyze "
157 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
158 edm::LogInfo(
"AnalyzerMB") <<
"Event with " << myGenEvent->particles_size()
159 <<
" particles + " << myGenEvent->vertices_size()
172 std::map<HcalDetId,double> hitMap;
173 for (std::vector<PCaloHit>::const_iterator hcalItr = HitHcal->begin();
174 hcalItr != HitHcal->end(); ++hcalItr) {
175 double time = hcalItr->time();
177 double energyhit = hcalItr->energy();
179 std::map<HcalDetId,double>::iterator itr1 = hitMap.find(hid);
180 if (itr1 == hitMap.end()) {
182 itr1 = hitMap.find(hid);
184 itr1->second += energyhit;
187 edm::LogInfo(
"AnalyzerMB") <<
"extract information of " << hitMap.size()
188 <<
" towers from " << HitHcal->size() <<
" hits";
190 for (std::map<HcalDetId,double>::const_iterator hcalItr=hitMap.begin();
191 hcalItr != hitMap.end(); ++hcalItr) {
193 double energyhit = hcalItr->second;
194 std::map<HcalDetId,myInfo>::iterator itr1 =
myMap_.find(hid);
195 if (itr1 ==
myMap_.end()) {
200 itr1->second.theMB0++;
201 itr1->second.theMB1 += energyhit;
202 itr1->second.theMB2 += (energyhit*energyhit);
203 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
204 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
205 edm::LogInfo(
"AnalyzerMB") <<
"ID " << hid <<
" with energy " << energyhit;
std::map< HcalDetId, myInfo > myMap_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< PCaloHit > PCaloHitContainer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hcal_
std::string fOutputFileName_
T const * product() const
SimAnalyzerMinbias(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)