CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
BasicHepMCHeavyIonValidation Class Reference

#include <BasicHepMCHeavyIonValidation.h>

Inheritance diagram for BasicHepMCHeavyIonValidation:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup const &) override
 
 BasicHepMCHeavyIonValidation (const edm::ParameterSet &)
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
virtual ~BasicHepMCHeavyIonValidation ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

MonitorElementeccentricity
 
MonitorElementevent_plane_angle
 
edm::InputTag hepmcCollection_
 
edm::EDGetTokenT
< edm::HepMCProduct
hepmcCollectionToken_
 
MonitorElementimpact_parameter
 
MonitorElementN_Nwounded_collisions
 
MonitorElementNcoll
 
MonitorElementNcoll_hard
 
MonitorElementnEvt
 PDT table. More...
 
MonitorElementNpart_proj
 
MonitorElementNpart_targ
 
MonitorElementNwounded_N_collisions
 
MonitorElementNwounded_Nwounded_collisions
 
bool QWdebug_
 
MonitorElementsigma_inel_NN
 
MonitorElementspectator_neutrons
 
MonitorElementspectator_protons
 
WeightManager wmanager_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 34 of file BasicHepMCHeavyIonValidation.h.

Constructor & Destructor Documentation

BasicHepMCHeavyIonValidation::BasicHepMCHeavyIonValidation ( const edm::ParameterSet iPSet)
explicit

Definition at line 14 of file BasicHepMCHeavyIonValidation.cc.

References edm::ParameterSet::getUntrackedParameter(), hepmcCollection_, hepmcCollectionToken_, and QWdebug_.

14  :
16  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection"))
17 {
18  QWdebug_ = iPSet.getUntrackedParameter<bool>("QWdebug",false);
19 
20  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
21 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
BasicHepMCHeavyIonValidation::~BasicHepMCHeavyIonValidation ( )
virtual

Definition at line 23 of file BasicHepMCHeavyIonValidation.cc.

23 {}

Member Function Documentation

void BasicHepMCHeavyIonValidation::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

counters to zero for every event

Gathering the HepMCProduct information

Implements edm::stream::EDAnalyzerBase.

Definition at line 51 of file BasicHepMCHeavyIonValidation.cc.

References gather_cfg::cout, eccentricity, event_plane_angle, MonitorElement::Fill(), edm::Event::getByToken(), hepmcCollectionToken_, impact_parameter, N_Nwounded_collisions, Ncoll, Ncoll_hard, nEvt, Npart_proj, Npart_targ, Nwounded_N_collisions, Nwounded_Nwounded_collisions, QWdebug_, sigma_inel_NN, spectator_neutrons, spectator_protons, WeightManager::weight(), histoStyle::weight, and wmanager_.

51  {
53 
56  iEvent.getByToken(hepmcCollectionToken_, evt);
57 
58  //Get EVENT
59  //HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
60 
61 
62 
63  const HepMC::HeavyIon* ion = evt->GetEvent()->heavy_ion();
64 
65  if (!ion) {
66  if ( QWdebug_ ) std::cout << "!!QW!! HeavyIon == null" << std::endl;
67  return;
68  }
69 
70  double weight = wmanager_.weight(iEvent);
71  nEvt->Fill(0.5,weight);
72 
73  Ncoll_hard->Fill(ion->Ncoll_hard(), weight);
74  Npart_proj->Fill(ion->Npart_proj(), weight);
75  Npart_targ->Fill(ion->Npart_targ(), weight);
76  Ncoll->Fill(ion->Ncoll(), weight);
77  N_Nwounded_collisions->Fill(ion->N_Nwounded_collisions(), weight);
78  Nwounded_N_collisions->Fill(ion->Nwounded_N_collisions(), weight);
79  Nwounded_Nwounded_collisions->Fill(ion->Nwounded_Nwounded_collisions(), weight);
80  spectator_neutrons->Fill(ion->spectator_neutrons(), weight);
81  spectator_protons->Fill(ion->spectator_protons(), weight);
82  impact_parameter->Fill(ion->impact_parameter(), weight);
83  event_plane_angle->Fill(ion->event_plane_angle(), weight);
84  eccentricity->Fill(ion->eccentricity(), weight);
85  sigma_inel_NN->Fill(ion->sigma_inel_NN(), weight);
86 
87 
88  //delete myGenEvent;
89 }//analyze
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
tuple cout
Definition: gather_cfg.py:121
int weight
Definition: histoStyle.py:50
double weight(const edm::Event &)
void BasicHepMCHeavyIonValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Setting the DQM top directories

Booking the ME's

Implements DQMEDAnalyzer.

Definition at line 25 of file BasicHepMCHeavyIonValidation.cc.

References DQMStore::IBooker::book1D(), eccentricity, event_plane_angle, impact_parameter, N_Nwounded_collisions, Ncoll, Ncoll_hard, nEvt, Npart_proj, Npart_targ, Nwounded_N_collisions, Nwounded_Nwounded_collisions, pi, DQMStore::IBooker::setCurrentFolder(), sigma_inel_NN, spectator_neutrons, and spectator_protons.

25  {
26 
28  i.setCurrentFolder("Generator/HeavyIon");
29 
30  // Number of analyzed events
31  nEvt = i.book1D("nEvt", "n analyzed Events", 1, 0., 1.);
32 
34  Ncoll_hard = i.book1D("Ncoll_hard", "Ncoll_hard", 700, 0, 700);
35  Npart_proj = i.book1D("Npart_proj", "Npart_proj", 250, 0, 250);
36  Npart_targ = i.book1D("Npart_targ", "Npart_targ", 250, 0, 250);
37  Ncoll = i.book1D("Ncoll", "Ncoll", 700, 0, 700);
38  N_Nwounded_collisions = i.book1D("N_Nwounded_collisions", "N_Nwounded_collisions", 250, 0, 250);
39  Nwounded_N_collisions = i.book1D("Nwounded_N_collisions", "Nwounded_N_collisions", 250, 0, 250);
40  Nwounded_Nwounded_collisions = i.book1D("Nwounded_Nwounded_collisions", "Nwounded_Nwounded_collisions", 250, 0, 250);
41  spectator_neutrons = i.book1D("spectator_neutrons", "spectator_neutrons", 250, 0, 250);
42  spectator_protons = i.book1D("spectator_protons", "spectator_protons", 250, 0, 250);
43  impact_parameter = i.book1D("impact_parameter", "impact_parameter", 50, 0, 50);
44  event_plane_angle = i.book1D("event_plane_angle", "event_plane_angle", 200, -CLHEP::pi, CLHEP::pi);
45  eccentricity = i.book1D("eccentricity", "eccentricity", 200, 0, 1.0);
46  sigma_inel_NN = i.book1D("sigma_inel_NN", "sigma_inel_NN", 200, 0, 10.0);
47 
48  return;
49 }
const Double_t pi
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274

Member Data Documentation

MonitorElement* BasicHepMCHeavyIonValidation::eccentricity
private

Definition at line 64 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::event_plane_angle
private

Definition at line 63 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag BasicHepMCHeavyIonValidation::hepmcCollection_
private

Definition at line 44 of file BasicHepMCHeavyIonValidation.h.

Referenced by BasicHepMCHeavyIonValidation().

edm::EDGetTokenT<edm::HepMCProduct> BasicHepMCHeavyIonValidation::hepmcCollectionToken_
private

Definition at line 70 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and BasicHepMCHeavyIonValidation().

MonitorElement* BasicHepMCHeavyIonValidation::impact_parameter
private

Definition at line 62 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::N_Nwounded_collisions
private

Definition at line 57 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Ncoll
private

Definition at line 56 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Ncoll_hard
private

Definition at line 53 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::nEvt
private

PDT table.

Definition at line 50 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Npart_proj
private

Definition at line 54 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Npart_targ
private

Definition at line 55 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Nwounded_N_collisions
private

Definition at line 58 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::Nwounded_Nwounded_collisions
private

Definition at line 59 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

bool BasicHepMCHeavyIonValidation::QWdebug_
private

Definition at line 45 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and BasicHepMCHeavyIonValidation().

MonitorElement* BasicHepMCHeavyIonValidation::sigma_inel_NN
private

Definition at line 67 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::spectator_neutrons
private

Definition at line 60 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BasicHepMCHeavyIonValidation::spectator_protons
private

Definition at line 61 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and bookHistograms().

WeightManager BasicHepMCHeavyIonValidation::wmanager_
private

Definition at line 43 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze().