53 : fileName_(iConfig.getParameter<
std::
string>(
"fileName")),
54 minbunch_(iConfig.getParameter<
int>(
"minBunch")),
55 maxbunch_(iConfig.getParameter<
int>(
"maxBunch")) {
86 new TH1I(
"TrackerHit_Tof_bcr",
"TrackerHit_ToF", 100,
float(bsp *
minbunch_),
float(bsp *
maxbunch_) + 50.);
88 "SignalTrackerHit_Tof_bcr",
"TrackerHit_ToF", 100,
float(bsp * minbunch_),
float(bsp * maxbunch_) + 50.);
92 new TH1I(
"histoHepMCProduct",
"Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
101 tag =
edm::InputTag(
"mix",
"g4SimHitsTrackerHitsTECHighTof");
128 <<
" Please, check if the object SimTracks has been declared in the" 129 <<
" MixingModule configuration file." << std::endl;
132 outputFile <<
"\n=================== Starting SimTrack access ===================" << std::endl;
137 std::cout <<
" \nWe got " << col1->sizeSignal() <<
" signal tracks and " << col1->sizePileup()
138 <<
" pileup tracks, total: " << col1->size() << std::endl;
139 for (cfi1 = col1->begin(); cfi1 != col1->end(); cfi1++) {
151 outputFile <<
" SimTrack " << count1 <<
" has genpart index " << cfi1->genpartIndex() <<
" vertex Index " 152 << cfi1->vertIndex() <<
" bunchcr " << cfi1.
bunch() <<
" trigger " << cfi1.
getTrigger()
153 <<
", from EncodedEventId: " << cfi1->eventId().bunchCrossing() <<
" " << cfi1->eventId().event()
165 outputFile <<
" Could not read Simvertices !!!!" << std::endl;
167 outputFile <<
"\n=================== Starting SimVertex access ===================" << std::endl;
171 outputFile <<
" \nWe got " << col2->sizeSignal() <<
" signal vertices and " << col2->sizePileup()
172 <<
" pileup vertices, total: " << col2->size() << std::endl;
173 for (cfi2 = col2->begin(); cfi2 != col2->end(); cfi2++) {
176 if (count2 == 0 || b == 3) {
190 std::cout <<
" Could not read HepMCProducts!!!!" << std::endl;
192 outputFile <<
"\n=================== Starting HepMCProduct access ===================" << std::endl;
193 std::unique_ptr<MixCollection<edm::HepMCProduct>> colhepmc(
198 outputFile <<
" \nWe got " << colhepmc->sizeSignal() <<
" signal hepmc products and " << colhepmc->sizePileup()
199 <<
" pileup hepmcs, total: " << colhepmc->size() << std::endl;
200 for (cfihepmc = colhepmc->begin(); cfihepmc != colhepmc->end(); cfihepmc++) {
203 if (count3 == 0 || c == 3) {
214 const std::string subdetcalo(
"g4SimHitsEcalHitsEB");
218 outputFile <<
" Could not read CaloHits with label " << subdetcalo <<
"!!!!" << std::endl;
220 outputFile <<
"\n\n=================== Starting CaloHit access, subdet " << subdetcalo
221 <<
" ===================" << std::endl;
226 for (cficalo = colcalo->begin(); cficalo != colcalo->end(); cficalo++) {
229 if (count4 == 0 || d == 3) {
239 const std::string subdet(
"g4SimHitsTrackerHitsTECHighTof");
243 outputFile <<
" Could not read SimHits with label " << subdet <<
"!!!!" << std::endl;
245 outputFile <<
"\n\n=================== Starting SimHit access, subdet " << subdet
246 <<
" ===================" << std::endl;
252 for (cfi = col->begin(); cfi != col->end(); cfi++) {
262 std::cout <<
" cfi->timeOfFlight() = " << cfi->timeOfFlight() << std::endl;
263 tofhist_->Fill(cfi->timeOfFlight());
268 outputFile <<
" Hit " << count5 <<
" has tof " << cfi->timeOfFlight() <<
" trackid " << cfi->trackId()
270 <<
", from EncodedEventId: " << cfi->eventId().bunchCrossing() <<
" " << cfi->eventId().event()
271 <<
" bcr from MixCol " << cfi.
bunch() << std::endl;
281 outputFile <<
" Could not read SimHits with label " << subdet1 <<
"!!!!" << std::endl;
283 outputFile <<
"\n\n=================== Starting SimHit access, subdet " << subdet1
284 <<
" ===================" << std::endl;
290 for (cfi = col->begin(); cfi != col->end(); cfi++) {
299 outputFile <<
" Hit " << count5 <<
" has tof " << cfi->timeOfFlight() <<
" trackid " << cfi->trackId()
301 <<
", from EncodedEventId: " << cfi->eventId().bunchCrossing() <<
" " << cfi->eventId().event()
302 <<
" bcr from MixCol " << cfi.
bunch() << std::endl;
313 std::cout <<
"Unable to open file!" << std::endl;
323 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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TH1I * histTrack_bunchPileups_
TH1I * histHepMCProduct_bunch_
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuonToken_
TH1I * histPCaloHit_bunch_
~TestMixedSource() override
edm::EDGetTokenT< CrossingFrame< PCaloHit > > CaloToken1_
edm::EDGetTokenT< CrossingFrame< SimVertex > > SimVertexToken_
T const * product() const
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > HepMCToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
TestMixedSource(const edm::ParameterSet &)