57 : fileName_(iConfig.getParameter<std::string>(
"fileName")), minbunch_(iConfig.getParameter<int>(
"minBunch")),maxbunch_(iConfig.getParameter<int>(
"maxBunch"))
77 tofhist_sig_ =
new TH1I(
"SignalTrackerHit_Tof_bcr",
"TrackerHit_ToF",100,
float(bsp*minbunch_),
float(bsp*maxbunch_)+50.);
81 histHepMCProduct_bunch_ =
new TH1I(
"histoHepMCProduct",
"Bunchcrossings",maxbunch_-minbunch_+1,minbunch_,maxbunch_+1);
87 {
std::cout <<
" Destructor TestMixed" << std::endl;
103 bool gotTracks = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simtrack);
104 if (!gotTracks)
outputFile<<
" Could not read SimTracks!!!!"
105 <<
" Please, check if the object SimTracks has been declared in the"
106 <<
" MixingModule configuration file."<<std::endl;
109 outputFile<<
"\n=================== Starting SimTrack access ==================="<<std::endl;
114 std::cout <<
" \nWe got "<<col1->sizeSignal()<<
" signal tracks and "<<col1->sizePileup()<<
" pileup tracks, total: "<<col1->size()<<std::endl;
115 for (cfi1=col1->begin(); cfi1!=col1->end();cfi1++) {
128 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;
138 bool gotSimVertex = iEvent.
getByLabel(
"mix",
"g4SimHits",cf_simvtx);
139 if (!gotSimVertex)
outputFile<<
" Could not read Simvertices !!!!"<<std::endl;
141 outputFile<<
"\n=================== Starting SimVertex access ==================="<<std::endl;
145 outputFile <<
" \nWe got "<<col2->sizeSignal()<<
" signal vertices and "<<col2->sizePileup()<<
" pileup vertices, total: "<<col2->size()<<std::endl;
146 for (cfi2=col2->begin(); cfi2!=col2->end();cfi2++) {
149 if (count2 == 0 || b==3){
162 bool gotHepMCP = iEvent.
getByLabel(
"mix",
"generator",cf_hepmc);
163 if (!gotHepMCP)
std::cout<<
" Could not read HepMCProducts!!!!"<<std::endl;
165 outputFile<<
"\n=================== Starting HepMCProduct access ==================="<<std::endl;
170 outputFile <<
" \nWe got "<<colhepmc->sizeSignal()<<
" signal hepmc products and "<<colhepmc->sizePileup()<<
" pileup hepmcs, total: "<<colhepmc->size()<<std::endl;
171 for (cfihepmc=colhepmc->begin(); cfihepmc!=colhepmc->end();cfihepmc++) {
174 if (count3==0 || c==3){
186 const std::string subdetcalo(
"g4SimHitsEcalHitsEB");
188 bool gotPCaloHit = iEvent.
getByLabel(
"mix",subdetcalo,cf_calo);
189 if (!gotPCaloHit)
outputFile<<
" Could not read CaloHits with label "<<subdetcalo<<
"!!!!"<<std::endl;
191 outputFile<<
"\n\n=================== Starting CaloHit access, subdet "<<subdetcalo<<
" ==================="<<std::endl;
196 for (cficalo=colcalo->begin(); cficalo!=colcalo->end();cficalo++) {
199 if (count4==0 || d==3){
211 const std::string subdet(
"g4SimHitsTrackerHitsTECHighTof");
213 bool gotPSimHit = iEvent.
getByLabel(
"mix",subdet,cf_simhit);
214 if (!gotPSimHit)
outputFile<<
" Could not read SimHits with label "<<subdet<<
"!!!!"<<std::endl;
216 outputFile<<
"\n\n=================== Starting SimHit access, subdet "<<subdet<<
" ==================="<<std::endl;
222 for (cfi=col->
begin(); cfi!=col->
end();cfi++) {
225 if (cfi.getTrigger()==1){
231 if (cfi.getTrigger()==0){
233 std::cout <<
" cfi->timeOfFlight() = " << cfi->timeOfFlight() << std::endl;
234 tofhist_->Fill(cfi->timeOfFlight());
239 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;
245 const std::string subdet1(
"g4SimHitsMuonCSCHits");
247 bool gotPSimHit1 = iEvent.
getByLabel(
"mix",subdet1,cf_simhit1);
248 if (!gotPSimHit1)
outputFile<<
" Could not read SimHits with label "<<subdet1<<
"!!!!"<<std::endl;
250 outputFile<<
"\n\n=================== Starting SimHit access, subdet "<<subdet1<<
" ==================="<<std::endl;
256 for (cfi=col->
begin(); cfi!=col->
end();cfi++) {
264 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;
282 std::cout <<
"Unable to open file!" << std::endl;
295 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_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
TestMixedSource(const edm::ParameterSet &)