56 : fileName_(iConfig.getParameter<std::
string>(
"fileName")), minbunch_(iConfig.getParameter<int>(
"minBunch")),maxbunch_(iConfig.getParameter<int>(
"maxBunch"))
76 tofhist_sig_ =
new TH1I(
"SignalTrackerHit_Tof_bcr",
"TrackerHit_ToF",100,
float(bsp*minbunch_),
float(bsp*maxbunch_)+50.);
80 histHepMCProduct_bunch_ =
new TH1I(
"histoHepMCProduct",
"Bunchcrossings",maxbunch_-minbunch_+1,minbunch_,maxbunch_+1);
86 {
std::cout <<
" Destructor TestMixed" << std::endl;
102 bool gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simtrack);
103 if (!gotTracks)
outputFile<<
" Could not read SimTracks!!!!"
104 <<
" Please, check if the object SimTracks has been declared in the"
105 <<
" MixingModule configuration file."<<std::endl;
108 outputFile<<
"\n=================== Starting SimTrack access ==================="<<std::endl;
113 std::cout <<
" \nWe got "<<col1->sizeSignal()<<
" signal tracks and "<<col1->sizePileup()<<
" pileup tracks, total: "<<col1->size()<<std::endl;
114 for (cfi1=col1->begin(); cfi1!=col1->end();cfi1++) {
127 outputFile<<
" SimTrack "<<count1<<
" has genpart index "<<cfi1->genpartIndex()<<
" vertex Index "<<cfi1->vertIndex() <<
" bunchcr "<<cfi1.
bunch()<<
" trigger "<<cfi1.
getTrigger()<<
", from EncodedEventId: "<<cfi1->eventId().bunchCrossing() <<
" "<<cfi1->eventId().event() <<std::endl;
137 bool gotSimVertex = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simvtx);
138 if (!gotSimVertex)
outputFile<<
" Could not read Simvertices !!!!"<<std::endl;
140 outputFile<<
"\n=================== Starting SimVertex access ==================="<<std::endl;
144 outputFile <<
" \nWe got "<<col2->sizeSignal()<<
" signal vertices and "<<col2->sizePileup()<<
" pileup vertices, total: "<<col2->size()<<std::endl;
145 for (cfi2=col2->begin(); cfi2!=col2->end();cfi2++) {
148 if (count2 == 0 || b==3){
161 bool gotHepMCP = iEvent.
getByLabel(
"mix",
"generator",cf_hepmc);
162 if (!gotHepMCP)
std::cout<<
" Could not read HepMCProducts!!!!"<<std::endl;
164 outputFile<<
"\n=================== Starting HepMCProduct access ==================="<<std::endl;
169 outputFile <<
" \nWe got "<<colhepmc->sizeSignal()<<
" signal hepmc products and "<<colhepmc->sizePileup()<<
" pileup hepmcs, total: "<<colhepmc->size()<<std::endl;
170 for (cfihepmc=colhepmc->begin(); cfihepmc!=colhepmc->end();cfihepmc++) {
173 if (count3==0 || c==3){
185 const std::string subdetcalo(
"g4SimHitsEcalHitsEB");
187 bool gotPCaloHit = iEvent.
getByLabel(
"mix",subdetcalo,cf_calo);
188 if (!gotPCaloHit)
outputFile<<
" Could not read CaloHits with label "<<subdetcalo<<
"!!!!"<<std::endl;
190 outputFile<<
"\n\n=================== Starting CaloHit access, subdet "<<subdetcalo<<
" ==================="<<std::endl;
195 for (cficalo=colcalo->begin(); cficalo!=colcalo->end();cficalo++) {
198 if (count4==0 || d==3){
210 const std::string subdet(
"g4SimHitsTrackerHitsTECHighTof");
212 bool gotPSimHit = iEvent.
getByLabel(
"mix",subdet,cf_simhit);
213 if (!gotPSimHit)
outputFile<<
" Could not read SimHits with label "<<subdet<<
"!!!!"<<std::endl;
215 outputFile<<
"\n\n=================== Starting SimHit access, subdet "<<subdet<<
" ==================="<<std::endl;
221 for (cfi=col->begin(); cfi!=col->end();cfi++) {
232 std::cout <<
" cfi->timeOfFlight() = " << cfi->timeOfFlight() << std::endl;
233 tofhist_->Fill(cfi->timeOfFlight());
238 outputFile<<
" Hit "<<count5<<
" has tof "<<cfi->timeOfFlight()<<
" trackid "<<cfi->trackId() <<
" bunchcr "<<cfi.
bunch()<<
" trigger "<<cfi.
getTrigger()<<
", from EncodedEventId: "<<cfi->eventId().bunchCrossing()<<
" " <<cfi->eventId().event() <<
" bcr from MixCol "<<cfi.
bunch()<<std::endl;
246 bool gotPSimHit1 = iEvent.
getByLabel(
"mix",subdet1,cf_simhit1);
247 if (!gotPSimHit1)
outputFile<<
" Could not read SimHits with label "<<subdet1<<
"!!!!"<<std::endl;
249 outputFile<<
"\n\n=================== Starting SimHit access, subdet "<<subdet1<<
" ==================="<<std::endl;
255 for (cfi=col->begin(); cfi!=col->end();cfi++) {
263 outputFile<<
" Hit "<<count5<<
" has tof "<<cfi->timeOfFlight()<<
" trackid "<<cfi->trackId() <<
" bunchcr "<<cfi.
bunch()<<
" trigger "<<cfi.
getTrigger()<<
", from EncodedEventId: "<<cfi->eventId().bunchCrossing()<<
" " <<cfi->eventId().event() <<
" bcr from MixCol "<<cfi.
bunch()<<std::endl;
281 std::cout <<
"Unable to open file!" << std::endl;
294 std::cout <<
" fileName = " << t << std::endl;
TH1I * histTrack_bunchSignal_
TH1I * histPSimHit_bunchPileups_TrackerHitsTECHighTof_
TH1I * histPSimHit_bunchSignal_MuonCSCHits_
TH1I * histPSimHit_bunchPileups_MuonCSCHits_
TH1I * histPSimHit_bunchSignal_TrackerHitsTECHighTof_
TH1I * histTrack_bunchPileups_
TH1I * histHepMCProduct_bunch_
TH1I * histPCaloHit_bunch_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
TestMixedSource(const edm::ParameterSet &)