CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::TestMixedSource Class Reference

#include <TestMixedSource.h>

Inheritance diagram for edm::TestMixedSource:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TestMixedSource (const edm::ParameterSet &)
 
 ~TestMixedSource () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

int bunchcr_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > CaloToken1_
 
std::string fileName_
 
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > HepMCToken_
 
TFile * histFile_
 
TH1I * histHepMCProduct_bunch_
 
TH1I * histPCaloHit_bunch_
 
TH1I * histPSimHit_bunchPileups_MuonCSCHits_
 
TH1I * histPSimHit_bunchPileups_TrackerHitsTECHighTof_
 
TH1I * histPSimHit_bunchSignal_MuonCSCHits_
 
TH1I * histPSimHit_bunchSignal_TrackerHitsTECHighTof_
 
TH1I * histTrack_bunchPileups_
 
TH1I * histTrack_bunchSignal_
 
TH1I * histVertex_bunch_
 
int maxbunch_
 
int minbunch_
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuonToken_
 
std::ofstream outputFile
 
edm::EDGetTokenT< CrossingFrame< SimTrack > > SimTrackToken_
 
edm::EDGetTokenT< CrossingFrame< SimVertex > > SimVertexToken_
 
TH1I * tofhist_
 
TH1I * tofhist_sig_
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > TrackerToken0_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 51 of file TestMixedSource.h.

Constructor & Destructor Documentation

◆ TestMixedSource()

TestMixedSource::TestMixedSource ( const edm::ParameterSet iConfig)
explicit

Definition at line 51 of file TestMixedSource.cc.

References CaloToken1_, HepMCToken_, histHepMCProduct_bunch_, histPCaloHit_bunch_, histPSimHit_bunchPileups_MuonCSCHits_, histPSimHit_bunchPileups_TrackerHitsTECHighTof_, histPSimHit_bunchSignal_MuonCSCHits_, histPSimHit_bunchSignal_TrackerHitsTECHighTof_, histTrack_bunchPileups_, histTrack_bunchSignal_, histVertex_bunch_, HLT_2022v14_cff::InputTag, maxbunch_, minbunch_, MuonToken_, SimTrackToken_, SimVertexToken_, makeGlobalPositionRcd_cfg::tag, tofhist_, tofhist_sig_, and TrackerToken0_.

52  : fileName_(iConfig.getParameter<std::string>("fileName")),
53  minbunch_(iConfig.getParameter<int>("minBunch")),
54  maxbunch_(iConfig.getParameter<int>("maxBunch")) {
56  new TH1I("histoTrackSignal", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
58  new TH1I("histoTrackPileups", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
59 
60  // Vertex
61  histVertex_bunch_ = new TH1I("histoVertex", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
62 
63  // PCaloHit
65  new TH1I("histoPCaloHit", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
66 
67  // PSimHit
68  histPSimHit_bunchSignal_TrackerHitsTECHighTof_ = new TH1I("histoPSimHitTrackerHitsTECHighTofSignal",
69  "Bunchcrossings",
70  maxbunch_ - minbunch_ + 1,
71  minbunch_,
72  maxbunch_ + 1);
73  histPSimHit_bunchPileups_TrackerHitsTECHighTof_ = new TH1I("histoPSimHitTrackerHitsTECHighTofPileups",
74  "Bunchcrossings",
75  maxbunch_ - minbunch_ + 1,
76  minbunch_,
77  maxbunch_ + 1);
79  "histoPSimHitMuonCSCHitsSignal", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
81  "histoPSimHitMuonCSCHitsPileups", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
82 
83  int bsp = 25; //bunchspace
84  tofhist_ =
85  new TH1I("TrackerHit_Tof_bcr", "TrackerHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.);
86  tofhist_sig_ = new TH1I(
87  "SignalTrackerHit_Tof_bcr", "TrackerHit_ToF", 100, float(bsp * minbunch_), float(bsp * maxbunch_) + 50.);
88 
89  // HepMCProduct
91  new TH1I("histoHepMCProduct", "Bunchcrossings", maxbunch_ - minbunch_ + 1, minbunch_, maxbunch_ + 1);
92 
93  // Tokens
94 
95  edm::InputTag tag = edm::InputTag("mix", "g4SimHits");
96 
97  SimTrackToken_ = consumes<CrossingFrame<SimTrack>>(tag);
98  SimVertexToken_ = consumes<CrossingFrame<SimVertex>>(tag);
99 
100  tag = edm::InputTag("mix", "g4SimHitsTrackerHitsTECHighTof");
101  TrackerToken0_ = consumes<CrossingFrame<PSimHit>>(tag);
102 
103  tag = edm::InputTag("mix", "g4SimHitsEcalHitsEB");
104  CaloToken1_ = consumes<CrossingFrame<PCaloHit>>(tag);
105 
106  tag = edm::InputTag("mix", "g4SimHitsMuonCSCHits");
107  MuonToken_ = consumes<CrossingFrame<PSimHit>>(tag);
108 
109  tag = edm::InputTag("mix", "generatorSmeared");
110  HepMCToken_ = consumes<CrossingFrame<edm::HepMCProduct>>(tag);
111  }
TH1I * histPSimHit_bunchPileups_TrackerHitsTECHighTof_
TH1I * histPSimHit_bunchSignal_MuonCSCHits_
TH1I * histPSimHit_bunchPileups_MuonCSCHits_
edm::EDGetTokenT< CrossingFrame< PSimHit > > TrackerToken0_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< CrossingFrame< SimTrack > > SimTrackToken_
TH1I * histPSimHit_bunchSignal_TrackerHitsTECHighTof_
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuonToken_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > CaloToken1_
edm::EDGetTokenT< CrossingFrame< SimVertex > > SimVertexToken_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > HepMCToken_

◆ ~TestMixedSource()

TestMixedSource::~TestMixedSource ( )
override

Definition at line 113 of file TestMixedSource.cc.

References gather_cfg::cout.

113 { std::cout << " Destructor TestMixed" << std::endl; }

Member Function Documentation

◆ analyze()

void TestMixedSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 120 of file TestMixedSource.cc.

References a, b, MixCollection< T >::MixItr::bunch(), c, CaloToken1_, cuy::col, gather_cfg::cout, ztail::d, MillePedeFileConverter_cfg::e, MixCollection< T >::MixItr::getTrigger(), HepMCToken_, histHepMCProduct_bunch_, histPCaloHit_bunch_, histPSimHit_bunchPileups_MuonCSCHits_, histPSimHit_bunchPileups_TrackerHitsTECHighTof_, histPSimHit_bunchSignal_MuonCSCHits_, histPSimHit_bunchSignal_TrackerHitsTECHighTof_, histTrack_bunchPileups_, histTrack_bunchSignal_, histVertex_bunch_, iEvent, MuonToken_, outputFile, edm::Handle< T >::product(), SimTrackToken_, SimVertexToken_, AlCaHLTBitMon_QueryRunRegistry::string, tofhist_, tofhist_sig_, and TrackerToken0_.

120  {
121  // test SimTracks
122  //----------------------
124  bool gotTracks = iEvent.getByToken(SimTrackToken_, cf_simtrack);
125  if (!gotTracks)
126  outputFile << " Could not read SimTracks!!!!"
127  << " Please, check if the object SimTracks has been declared in the"
128  << " MixingModule configuration file." << std::endl;
129 
130  if (gotTracks) {
131  outputFile << "\n=================== Starting SimTrack access ===================" << std::endl;
132 
133  std::unique_ptr<MixCollection<SimTrack>> col1(new MixCollection<SimTrack>(cf_simtrack.product()));
135  int count1 = 0;
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++) {
139  //std::cout << " BUNCH cfi1.bunch() = " << cfi1.bunch() << std::endl;
140  if (cfi1.getTrigger() == 0) {
141  histTrack_bunchPileups_->Fill(cfi1.bunch());
142  }
143 
144  if (cfi1.getTrigger() == 1) {
145  histTrack_bunchSignal_->Fill(cfi1.bunch());
146  }
147 
148  int a = count1 % 4;
149  if (a == 3) {
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()
153  << std::endl;
154  }
155  count1++;
156  }
157  }
158 
159  // test SimVertices
160  //---------------------
162  bool gotSimVertex = iEvent.getByToken(SimVertexToken_, cf_simvtx);
163  if (!gotSimVertex)
164  outputFile << " Could not read Simvertices !!!!" << std::endl;
165  else {
166  outputFile << "\n=================== Starting SimVertex access ===================" << std::endl;
167  std::unique_ptr<MixCollection<SimVertex>> col2(new MixCollection<SimVertex>(cf_simvtx.product()));
169  int count2 = 0;
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++) {
173  histVertex_bunch_->Fill(cfi2.bunch());
174  int b = count2 % 4;
175  if (count2 == 0 || b == 3) {
176  //outputFile<<" SimVertex "<<count2<<" has parent index "<<cfi2->parentIndex()<<" bunchcr "<<cfi2.bunch()<<" trigger "<<cfi2.getTrigger()<<", from EncodedEventId: "<<cfi2->eventId().bunchCrossing() <<" "<<cfi2->eventId().event() <<std::endl;
177  }
178  //SimVertex myvtx=(*cfi2);
179  //outputFile<<"Same with op*: "<<count2<<" has parent index "<<myvtx.parentIndex()<<" bunchcr "<<cfi2.bunch()<<" trigger "<<cfi2.getTrigger()<<", from EncodedEventId: "<<myvtx.eventId().bunchCrossing() <<" "<<myvtx.eventId().event() <<std::endl;
180  count2++;
181  }
182  }
183 
184  //test HepMCProducts
185  //------------------------------------
187  bool gotHepMCP = iEvent.getByToken(HepMCToken_, cf_hepmc);
188  if (!gotHepMCP)
189  std::cout << " Could not read HepMCProducts!!!!" << std::endl;
190  else {
191  outputFile << "\n=================== Starting HepMCProduct access ===================" << std::endl;
192  std::unique_ptr<MixCollection<edm::HepMCProduct>> colhepmc(
193  new MixCollection<edm::HepMCProduct>(cf_hepmc.product()));
195 
196  int count3 = 0;
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++) {
200  histHepMCProduct_bunch_->Fill(cfihepmc.bunch());
201  int c = count3 % 4;
202  if (count3 == 0 || c == 3) {
203  //outputFile<<" edm::HepMCProduct "<<count3<<" has event number "<<cfihepmc->GetEvent()->event_number()<<", "<< cfihepmc->GetEvent()->particles_size()<<" particles and "<<cfihepmc->GetEvent()->vertices_size()<<" vertices, bunchcr= "<<cfihepmc.bunch()<<" trigger= "<<cfihepmc.getTrigger() <<" sourcetype= "<<cfihepmc.getSourceType()<<std::endl;
204  }
205  HepMCProduct myprod = colhepmc->getObject(count3);
206  //outputFile<<"same with getObject:hepmc product "<<count3<<" has event number "<<myprod.GetEvent()->event_number()<<", "<<myprod.GetEvent()->particles_size()<<" particles and "<<myprod.GetEvent()->vertices_size()<<" vertices"<<std::endl;
207  count3++;
208  }
209  }
210 
211  // test CaloHits
212  //--------------------------
213  const std::string subdetcalo("g4SimHitsEcalHitsEB");
215  bool gotPCaloHit = iEvent.getByToken(CaloToken1_, cf_calo);
216  if (!gotPCaloHit)
217  outputFile << " Could not read CaloHits with label " << subdetcalo << "!!!!" << std::endl;
218  else {
219  outputFile << "\n\n=================== Starting CaloHit access, subdet " << subdetcalo
220  << " ===================" << std::endl;
221  std::unique_ptr<MixCollection<PCaloHit>> colcalo(new MixCollection<PCaloHit>(cf_calo.product()));
222  //outputFile<<*(colcalo.get())<<std::endl;
224  int count4 = 0;
225  for (cficalo = colcalo->begin(); cficalo != colcalo->end(); cficalo++) {
226  histPCaloHit_bunch_->Fill(cficalo.bunch());
227  int d = count4 % 4;
228  if (count4 == 0 || d == 3) {
229  //outputFile<<" CaloHit "<<count4<<" has tof "<<cficalo->time()<<" trackid "<<cficalo->geantTrackId() <<" bunchcr "<<cficalo.bunch()<<" trigger "<<cficalo.getTrigger()<<", from EncodedEventId: "<<cficalo->eventId().bunchCrossing()<<" " <<cficalo->eventId().event() <<std::endl;
230  }
231  count4++;
232  }
233  }
234 
235  // test PSimHit for one particular subdet
236  //---------------------------------------
237 
238  const std::string subdet("g4SimHitsTrackerHitsTECHighTof");
240  bool gotPSimHit = iEvent.getByToken(TrackerToken0_, cf_simhit);
241  if (!gotPSimHit)
242  outputFile << " Could not read SimHits with label " << subdet << "!!!!" << std::endl;
243  else {
244  outputFile << "\n\n=================== Starting SimHit access, subdet " << subdet
245  << " ===================" << std::endl;
246 
247  std::unique_ptr<MixCollection<PSimHit>> col(new MixCollection<PSimHit>(cf_simhit.product()));
248  //outputFile<<*(col.get())<<std::endl;
250  int count5 = 0;
251  for (cfi = col->begin(); cfi != col->end(); cfi++) {
252  // Signal
253  if (cfi.getTrigger() == 1) {
255  tofhist_sig_->Fill(cfi->timeOfFlight());
256  }
257 
258  // Pileups
259  if (cfi.getTrigger() == 0) {
261  std::cout << " cfi->timeOfFlight() = " << cfi->timeOfFlight() << std::endl;
262  tofhist_->Fill(cfi->timeOfFlight());
263  }
264 
265  int e = count5 % 4;
266  if (e == 3) {
267  outputFile << " Hit " << count5 << " has tof " << cfi->timeOfFlight() << " trackid " << cfi->trackId()
268  << " bunchcr " << cfi.bunch() << " trigger " << cfi.getTrigger()
269  << ", from EncodedEventId: " << cfi->eventId().bunchCrossing() << " " << cfi->eventId().event()
270  << " bcr from MixCol " << cfi.bunch() << std::endl;
271  }
272  count5++;
273  }
274  }
275 
276  const std::string subdet1("g4SimHitsMuonCSCHits");
278  bool gotPSimHit1 = iEvent.getByToken(MuonToken_, cf_simhit1);
279  if (!gotPSimHit1)
280  outputFile << " Could not read SimHits with label " << subdet1 << "!!!!" << std::endl;
281  else {
282  outputFile << "\n\n=================== Starting SimHit access, subdet " << subdet1
283  << " ===================" << std::endl;
284 
285  std::unique_ptr<MixCollection<PSimHit>> col(new MixCollection<PSimHit>(cf_simhit1.product()));
286  //outputFile<<*(col.get())<<std::endl;
288  int count5 = 0;
289  for (cfi = col->begin(); cfi != col->end(); cfi++) {
290  if (cfi.getTrigger() == 1)
292 
293  if (cfi.getTrigger() == 0)
295 
296  int e = count5 % 4;
297  if (e == 3) {
298  outputFile << " Hit " << count5 << " has tof " << cfi->timeOfFlight() << " trackid " << cfi->trackId()
299  << " bunchcr " << cfi.bunch() << " trigger " << cfi.getTrigger()
300  << ", from EncodedEventId: " << cfi->eventId().bunchCrossing() << " " << cfi->eventId().event()
301  << " bcr from MixCol " << cfi.bunch() << std::endl;
302  }
303  count5++;
304  }
305  }
306  }
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_
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuonToken_
int iEvent
Definition: GenABIO.cc:224
d
Definition: ztail.py:151
bool getTrigger() const
Definition: MixCollection.h:97
edm::EDGetTokenT< CrossingFrame< PCaloHit > > CaloToken1_
edm::EDGetTokenT< CrossingFrame< SimVertex > > SimVertexToken_
double b
Definition: hdecay.h:118
std::ofstream outputFile
double a
Definition: hdecay.h:119
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > HepMCToken_
col
Definition: cuy.py:1009

◆ beginJob()

void TestMixedSource::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 309 of file TestMixedSource.cc.

References gather_cfg::cout, and outputFile.

309  {
310  outputFile.open("test.log");
311  if (!outputFile.is_open()) {
312  std::cout << "Unable to open file!" << std::endl;
313  }
314  }
std::ofstream outputFile

◆ endJob()

void TestMixedSource::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 317 of file TestMixedSource.cc.

References gather_cfg::cout, fileName_, histFile_, histHepMCProduct_bunch_, histPCaloHit_bunch_, histPSimHit_bunchPileups_MuonCSCHits_, histPSimHit_bunchPileups_TrackerHitsTECHighTof_, histPSimHit_bunchSignal_MuonCSCHits_, histPSimHit_bunchSignal_TrackerHitsTECHighTof_, histTrack_bunchPileups_, histTrack_bunchSignal_, histVertex_bunch_, outputFile, submitPVValidationJobs::t, tofhist_, and tofhist_sig_.

317  {
318  outputFile.close();
319 
320  char t[30];
321  sprintf(t, "%s", fileName_.c_str());
322  std::cout << " fileName = " << t << std::endl;
323  histFile_ = new TFile(t, "RECREATE");
324  histTrack_bunchPileups_->Write();
325  histTrack_bunchSignal_->Write();
326  histVertex_bunch_->Write();
327  histPCaloHit_bunch_->Write();
330  tofhist_sig_->Write();
331  tofhist_->Write();
334  histHepMCProduct_bunch_->Write();
335  histFile_->Write();
336  histFile_->Close();
337  }
TH1I * histPSimHit_bunchPileups_TrackerHitsTECHighTof_
TH1I * histPSimHit_bunchSignal_MuonCSCHits_
TH1I * histPSimHit_bunchPileups_MuonCSCHits_
TH1I * histPSimHit_bunchSignal_TrackerHitsTECHighTof_
std::ofstream outputFile

Member Data Documentation

◆ bunchcr_

int edm::TestMixedSource::bunchcr_
private

Definition at line 64 of file TestMixedSource.h.

◆ CaloToken1_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > edm::TestMixedSource::CaloToken1_
private

Definition at line 83 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().

◆ fileName_

std::string edm::TestMixedSource::fileName_
private

Definition at line 63 of file TestMixedSource.h.

Referenced by endJob().

◆ HepMCToken_

edm::EDGetTokenT<CrossingFrame<edm::HepMCProduct> > edm::TestMixedSource::HepMCToken_
private

Definition at line 87 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().

◆ histFile_

TFile* edm::TestMixedSource::histFile_
private

Definition at line 78 of file TestMixedSource.h.

Referenced by endJob().

◆ histHepMCProduct_bunch_

TH1I* edm::TestMixedSource::histHepMCProduct_bunch_
private

Definition at line 77 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histPCaloHit_bunch_

TH1I* edm::TestMixedSource::histPCaloHit_bunch_
private

Definition at line 70 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histPSimHit_bunchPileups_MuonCSCHits_

TH1I* edm::TestMixedSource::histPSimHit_bunchPileups_MuonCSCHits_
private

Definition at line 76 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histPSimHit_bunchPileups_TrackerHitsTECHighTof_

TH1I* edm::TestMixedSource::histPSimHit_bunchPileups_TrackerHitsTECHighTof_
private

Definition at line 72 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histPSimHit_bunchSignal_MuonCSCHits_

TH1I* edm::TestMixedSource::histPSimHit_bunchSignal_MuonCSCHits_
private

Definition at line 75 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histPSimHit_bunchSignal_TrackerHitsTECHighTof_

TH1I* edm::TestMixedSource::histPSimHit_bunchSignal_TrackerHitsTECHighTof_
private

Definition at line 71 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histTrack_bunchPileups_

TH1I* edm::TestMixedSource::histTrack_bunchPileups_
private

Definition at line 67 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histTrack_bunchSignal_

TH1I* edm::TestMixedSource::histTrack_bunchSignal_
private

Definition at line 68 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ histVertex_bunch_

TH1I* edm::TestMixedSource::histVertex_bunch_
private

Definition at line 69 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ maxbunch_

int edm::TestMixedSource::maxbunch_
private

Definition at line 66 of file TestMixedSource.h.

Referenced by TestMixedSource().

◆ minbunch_

int edm::TestMixedSource::minbunch_
private

Definition at line 65 of file TestMixedSource.h.

Referenced by TestMixedSource().

◆ MuonToken_

edm::EDGetTokenT<CrossingFrame<PSimHit> > edm::TestMixedSource::MuonToken_
private

Definition at line 81 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().

◆ outputFile

std::ofstream edm::TestMixedSource::outputFile
private

Definition at line 62 of file TestMixedSource.h.

Referenced by analyze(), beginJob(), and endJob().

◆ SimTrackToken_

edm::EDGetTokenT<CrossingFrame<SimTrack> > edm::TestMixedSource::SimTrackToken_
private

Definition at line 85 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().

◆ SimVertexToken_

edm::EDGetTokenT<CrossingFrame<SimVertex> > edm::TestMixedSource::SimVertexToken_
private

Definition at line 86 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().

◆ tofhist_

TH1I* edm::TestMixedSource::tofhist_
private

Definition at line 73 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ tofhist_sig_

TH1I* edm::TestMixedSource::tofhist_sig_
private

Definition at line 74 of file TestMixedSource.h.

Referenced by analyze(), endJob(), and TestMixedSource().

◆ TrackerToken0_

edm::EDGetTokenT<CrossingFrame<PSimHit> > edm::TestMixedSource::TrackerToken0_
private

Definition at line 80 of file TestMixedSource.h.

Referenced by analyze(), and TestMixedSource().