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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 BasicHepMCHeavyIonValidation (const edm::ParameterSet &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
virtual ~BasicHepMCHeavyIonValidation ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

DQMStoredbe
 PDT table. More...
 
MonitorElementeccentricity
 
MonitorElementevent_plane_angle
 
edm::InputTag hepmcCollection_
 
edm::EDGetTokenT
< edm::HepMCProduct
hepmcCollectionToken_
 
MonitorElementimpact_parameter
 
MonitorElementN_Nwounded_collisions
 
MonitorElementNcoll
 
MonitorElementNcoll_hard
 
MonitorElementnEvt
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 33 of file BasicHepMCHeavyIonValidation.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file BasicHepMCHeavyIonValidation.cc.

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

14  :
16  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection"))
17 {
18  dbe = 0;
20  QWdebug_ = iPSet.getUntrackedParameter<bool>("QWdebug",false);
21 
22  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
23 }
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 25 of file BasicHepMCHeavyIonValidation.cc.

25 {}

Member Function Documentation

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

counters to zero for every event

Gathering the HepMCProduct information

Implements edm::EDAnalyzer.

Definition at line 63 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_.

64 {
66 
69  iEvent.getByToken(hepmcCollectionToken_, evt);
70 
71  //Get EVENT
72  //HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
73 
74 
75 
76  const HepMC::HeavyIon* ion = evt->GetEvent()->heavy_ion();
77 
78  if (!ion) {
79  if ( QWdebug_ ) std::cout << "!!QW!! HeavyIon == null" << std::endl;
80  return;
81  }
82 
83  double weight = wmanager_.weight(iEvent);
84  nEvt->Fill(0.5,weight);
85 
86  Ncoll_hard->Fill(ion->Ncoll_hard(), weight);
87  Npart_proj->Fill(ion->Npart_proj(), weight);
88  Npart_targ->Fill(ion->Npart_targ(), weight);
89  Ncoll->Fill(ion->Ncoll(), weight);
90  N_Nwounded_collisions->Fill(ion->N_Nwounded_collisions(), weight);
91  Nwounded_N_collisions->Fill(ion->Nwounded_N_collisions(), weight);
92  Nwounded_Nwounded_collisions->Fill(ion->Nwounded_Nwounded_collisions(), weight);
93  spectator_neutrons->Fill(ion->spectator_neutrons(), weight);
94  spectator_protons->Fill(ion->spectator_protons(), weight);
95  impact_parameter->Fill(ion->impact_parameter(), weight);
96  event_plane_angle->Fill(ion->event_plane_angle(), weight);
97  eccentricity->Fill(ion->eccentricity(), weight);
98  sigma_inel_NN->Fill(ion->sigma_inel_NN(), weight);
99 
100 
101  //delete myGenEvent;
102 }//analyze
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void Fill(long long x)
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::beginJob ( void  )
virtual

Setting the DQM top directories

Booking the ME's

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file BasicHepMCHeavyIonValidation.cc.

References DQMStore::book1D(), dbe, 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::setCurrentFolder(), sigma_inel_NN, spectator_neutrons, and spectator_protons.

28 {
29  if(dbe){
31  dbe->setCurrentFolder("Generator/HeavyIon");
32 
33  // Number of analyzed events
34  nEvt = dbe->book1D("nEvt", "n analyzed Events", 1, 0., 1.);
35 
37  Ncoll_hard = dbe->book1D("Ncoll_hard", "Ncoll_hard", 700, 0, 700);
38  Npart_proj = dbe->book1D("Npart_proj", "Npart_proj", 250, 0, 250);
39  Npart_targ = dbe->book1D("Npart_targ", "Npart_targ", 250, 0, 250);
40  Ncoll = dbe->book1D("Ncoll", "Ncoll", 700, 0, 700);
41  N_Nwounded_collisions = dbe->book1D("N_Nwounded_collisions", "N_Nwounded_collisions", 250, 0, 250);
42  Nwounded_N_collisions = dbe->book1D("Nwounded_N_collisions", "Nwounded_N_collisions", 250, 0, 250);
43  Nwounded_Nwounded_collisions = dbe->book1D("Nwounded_Nwounded_collisions", "Nwounded_Nwounded_collisions", 250, 0, 250);
44  spectator_neutrons = dbe->book1D("spectator_neutrons", "spectator_neutrons", 250, 0, 250);
45  spectator_protons = dbe->book1D("spectator_protons", "spectator_protons", 250, 0, 250);
46  impact_parameter = dbe->book1D("impact_parameter", "impact_parameter", 50, 0, 50);
47  event_plane_angle = dbe->book1D("event_plane_angle", "event_plane_angle", 200, -CLHEP::pi, CLHEP::pi);
48  eccentricity = dbe->book1D("eccentricity", "eccentricity", 200, 0, 1.0);
49  sigma_inel_NN = dbe->book1D("sigma_inel_NN", "sigma_inel_NN", 200, 0, 10.0);
50 
51  }
52  return;
53 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
double pi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void BasicHepMCHeavyIonValidation::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Get PDT Table

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file BasicHepMCHeavyIonValidation.cc.

57 {
59  //iSetup.getData( fPDGTable );
60  return;
61 }
void BasicHepMCHeavyIonValidation::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file BasicHepMCHeavyIonValidation.cc.

55 {return;}
void BasicHepMCHeavyIonValidation::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file BasicHepMCHeavyIonValidation.cc.

62 {return;}

Member Data Documentation

DQMStore* BasicHepMCHeavyIonValidation::dbe
private

PDT table.

ME's "container"

Definition at line 53 of file BasicHepMCHeavyIonValidation.h.

Referenced by BasicHepMCHeavyIonValidation(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::eccentricity
private

Definition at line 69 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::event_plane_angle
private

Definition at line 68 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

edm::InputTag BasicHepMCHeavyIonValidation::hepmcCollection_
private

Definition at line 46 of file BasicHepMCHeavyIonValidation.h.

Referenced by BasicHepMCHeavyIonValidation().

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

Definition at line 75 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and BasicHepMCHeavyIonValidation().

MonitorElement* BasicHepMCHeavyIonValidation::impact_parameter
private

Definition at line 67 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::N_Nwounded_collisions
private

Definition at line 62 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Ncoll
private

Definition at line 61 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Ncoll_hard
private

Definition at line 58 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::nEvt
private

Definition at line 55 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Npart_proj
private

Definition at line 59 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Npart_targ
private

Definition at line 60 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Nwounded_N_collisions
private

Definition at line 63 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::Nwounded_Nwounded_collisions
private

Definition at line 64 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

bool BasicHepMCHeavyIonValidation::QWdebug_
private

Definition at line 47 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and BasicHepMCHeavyIonValidation().

MonitorElement* BasicHepMCHeavyIonValidation::sigma_inel_NN
private

Definition at line 72 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::spectator_neutrons
private

Definition at line 65 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* BasicHepMCHeavyIonValidation::spectator_protons
private

Definition at line 66 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze(), and beginJob().

WeightManager BasicHepMCHeavyIonValidation::wmanager_
private

Definition at line 45 of file BasicHepMCHeavyIonValidation.h.

Referenced by analyze().