52 : fileName_(iConfig.getParameter<
std::
string>(
"fileName")),
53 minbunch_(iConfig.getParameter<
int>(
"minBunch")),
54 maxbunch_(iConfig.getParameter<
int>(
"maxBunch")) {
85 new TH1I(
"TrackerHit_Tof_bcr",
"TrackerHit_ToF", 100,
float(bsp *
minbunch_),
float(bsp *
maxbunch_) + 50.);
87 "SignalTrackerHit_Tof_bcr",
"TrackerHit_ToF", 100,
float(bsp *
minbunch_),
float(bsp *
maxbunch_) + 50.);
127 <<
" Please, check if the object SimTracks has been declared in the" 128 <<
" MixingModule configuration file." << std::endl;
131 outputFile <<
"\n=================== Starting SimTrack access ===================" << std::endl;
136 std::cout <<
" \nWe got " << col1->sizeSignal() <<
" signal tracks and " << col1->sizePileup()
137 <<
" pileup tracks, total: " << col1->size() << std::endl;
138 for (cfi1 = col1->begin(); cfi1 != col1->end(); cfi1++) {
150 outputFile <<
" SimTrack " << count1 <<
" has genpart index " << cfi1->genpartIndex() <<
" vertex Index " 151 << cfi1->vertIndex() <<
" bunchcr " << cfi1.
bunch() <<
" trigger " << cfi1.
getTrigger()
152 <<
", from EncodedEventId: " << cfi1->eventId().bunchCrossing() <<
" " << cfi1->eventId().event()
164 outputFile <<
" Could not read Simvertices !!!!" << std::endl;
166 outputFile <<
"\n=================== Starting SimVertex access ===================" << std::endl;
170 outputFile <<
" \nWe got " << col2->sizeSignal() <<
" signal vertices and " << col2->sizePileup()
171 <<
" pileup vertices, total: " << col2->size() << std::endl;
172 for (cfi2 = col2->begin(); cfi2 != col2->end(); cfi2++) {
175 if (count2 == 0 ||
b == 3) {
189 std::cout <<
" Could not read HepMCProducts!!!!" << std::endl;
191 outputFile <<
"\n=================== Starting HepMCProduct access ===================" << std::endl;
192 std::unique_ptr<MixCollection<edm::HepMCProduct>> colhepmc(
197 outputFile <<
" \nWe got " << colhepmc->sizeSignal() <<
" signal hepmc products and " << colhepmc->sizePileup()
198 <<
" pileup hepmcs, total: " << colhepmc->size() << std::endl;
199 for (cfihepmc = colhepmc->begin(); cfihepmc != colhepmc->end(); cfihepmc++) {
202 if (count3 == 0 ||
c == 3) {
213 const std::string subdetcalo(
"g4SimHitsEcalHitsEB");
217 outputFile <<
" Could not read CaloHits with label " << subdetcalo <<
"!!!!" << std::endl;
219 outputFile <<
"\n\n=================== Starting CaloHit access, subdet " << subdetcalo
220 <<
" ===================" << std::endl;
225 for (cficalo = colcalo->begin(); cficalo != colcalo->end(); cficalo++) {
228 if (count4 == 0 ||
d == 3) {
238 const std::string subdet(
"g4SimHitsTrackerHitsTECHighTof");
242 outputFile <<
" Could not read SimHits with label " << subdet <<
"!!!!" << std::endl;
244 outputFile <<
"\n\n=================== Starting SimHit access, subdet " << subdet
245 <<
" ===================" << std::endl;
251 for (cfi =
col->begin(); cfi !=
col->end(); cfi++) {
261 std::cout <<
" cfi->timeOfFlight() = " << cfi->timeOfFlight() << std::endl;
262 tofhist_->Fill(cfi->timeOfFlight());
267 outputFile <<
" Hit " << count5 <<
" has tof " << cfi->timeOfFlight() <<
" trackid " << cfi->trackId()
269 <<
", from EncodedEventId: " << cfi->eventId().bunchCrossing() <<
" " << cfi->eventId().event()
270 <<
" bcr from MixCol " << cfi.
bunch() << std::endl;
280 outputFile <<
" Could not read SimHits with label " << subdet1 <<
"!!!!" << std::endl;
282 outputFile <<
"\n\n=================== Starting SimHit access, subdet " << subdet1
283 <<
" ===================" << std::endl;
289 for (cfi =
col->begin(); cfi !=
col->end(); cfi++) {
298 outputFile <<
" Hit " << count5 <<
" has tof " << cfi->timeOfFlight() <<
" trackid " << cfi->trackId()
300 <<
", from EncodedEventId: " << cfi->eventId().bunchCrossing() <<
" " << cfi->eventId().event()
301 <<
" bcr from MixCol " << cfi.
bunch() << std::endl;
312 std::cout <<
"Unable to open file!" << std::endl;
322 std::cout <<
" fileName = " <<
t << std::endl;
TH1I * histTrack_bunchSignal_
TH1I * histPSimHit_bunchPileups_TrackerHitsTECHighTof_
TH1I * histPSimHit_bunchSignal_MuonCSCHits_
TH1I * histPSimHit_bunchPileups_MuonCSCHits_
edm::EDGetTokenT< CrossingFrame< PSimHit > > TrackerToken0_
edm::EDGetTokenT< CrossingFrame< SimTrack > > SimTrackToken_
TH1I * histPSimHit_bunchSignal_TrackerHitsTECHighTof_
TH1I * histTrack_bunchPileups_
T const * product() const
TH1I * histHepMCProduct_bunch_
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuonToken_
TH1I * histPCaloHit_bunch_
~TestMixedSource() override
edm::EDGetTokenT< CrossingFrame< PCaloHit > > CaloToken1_
edm::EDGetTokenT< CrossingFrame< SimVertex > > SimVertexToken_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > HepMCToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
TestMixedSource(const edm::ParameterSet &)