66 std::map<HcalDetId,myInfo>
myMap;
83 std::cout <<
"Use Time cut of " << timeCut <<
" ns and store o/p in "
102 myTree =
new TTree(
"SimJet",
"SimJet Tree");
103 myTree->Branch(
"mydet", &
mydet,
"mydet/I");
104 myTree->Branch(
"mysubd", &
mysubd,
"mysubd/I");
105 myTree->Branch(
"cells", &
cells,
"cells");
106 myTree->Branch(
"depth", &
depth,
"depth/I");
107 myTree->Branch(
"ieta", &
ieta,
"ieta/I");
108 myTree->Branch(
"iphi", &
iphi,
"iphi/I");
109 myTree->Branch(
"mom0_MB", &
mom0_MB,
"mom0_MB/F");
110 myTree->Branch(
"mom1_MB", &
mom1_MB,
"mom1_MB/F");
111 myTree->Branch(
"mom2_MB", &
mom2_MB,
"mom2_MB/F");
112 myTree->Branch(
"mom3_MB", &
mom2_MB,
"mom3_MB/F");
113 myTree->Branch(
"mom4_MB", &
mom4_MB,
"mom4_MB/F");
125 for (std::map<HcalDetId,myInfo>::const_iterator itr=
myMap.begin();
126 itr !=
myMap.end(); ++itr) {
128 mysubd = itr->first.subdet();
129 depth = itr->first.depth();
130 iphi = itr->first.iphi();
131 ieta = itr->first.ieta();
149 <<
mom3_MB <<
" mom4 " << mom4_MB << std::endl;
174 std::cout <<
" Start SimAnalyzerMinbias::analyze " << iEvent.
id().
run()
175 <<
":" << iEvent.
id().
event() << std::endl;
183 std::cout <<
"no HepMCProduct found" << std::endl;
186 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
187 edm::LogInfo(
"AnalyzerMB") <<
"Event with " << myGenEvent->particles_size()
188 <<
" particles + " << myGenEvent->vertices_size()
191 std::cout <<
"Event with " << myGenEvent->particles_size()
192 <<
" particles + " << myGenEvent->vertices_size()
193 <<
" vertices" << std::endl;
201 edm::LogInfo(
"AnalyzerMB") <<
"Error! can't get HcalHits product!";
203 std::cout <<
"Error! can't get HcalHits product!"
210 std::map<HcalDetId,double> hitMap;
211 for (std::vector<PCaloHit>::const_iterator hcalItr = HitHcal->begin ();
212 hcalItr != HitHcal->end(); ++hcalItr) {
213 double time = hcalItr->time();
215 double energyhit = hcalItr->energy();
217 std::map<HcalDetId,double>::iterator itr1 = hitMap.find(hid);
218 if (itr1 == hitMap.end()) {
220 itr1 = hitMap.find(hid);
222 itr1->second += energyhit;
226 std::cout <<
"extract information of " << hitMap.size() <<
" towers from "
227 << HitHcal->size() <<
" hits" << std::endl;
230 for (std::map<HcalDetId,double>::const_iterator hcalItr=hitMap.begin();
231 hcalItr != hitMap.end(); ++hcalItr) {
233 double energyhit = hcalItr->second;
234 std::map<HcalDetId,myInfo>::iterator itr1 =
myMap.find(hid);
235 if (itr1 ==
myMap.end()) {
238 itr1 =
myMap.find(hid);
240 itr1->second.theMB0++;
241 itr1->second.theMB1 += energyhit;
242 itr1->second.theMB2 += (energyhit*energyhit);
243 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
244 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
246 std::cout <<
"ID " << hid <<
" with energy " << energyhit << std::endl;
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_
T const * product() const
virtual void beginRun(const edm::Run &r, const edm::EventSetup &iSetup)
SimAnalyzerMinbias(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::map< HcalDetId, myInfo > myMap
std::string fOutputFileName
virtual void endRun(const edm::Run &r, const edm::EventSetup &iSetup)