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
FamosManager Class Reference

#include <FamosManager.h>

Public Member Functions

CalorimetryManagercalorimetryManager () const
 The calorimeter. More...
 
 FamosManager (edm::ParameterSet const &p)
 Constructor. More...
 
void reconstruct (const HepMC::GenEvent *evt, const reco::GenParticleCollection *particles, const HepMC::GenEvent *pu, const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
 The real thing is done here. More...
 
void reconstruct (const reco::GenParticleCollection *particles, const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
 
void setupGeometryAndField (edm::Run const &run, const edm::EventSetup &es)
 Get information from the Event Setup. More...
 
FSimEventsimEvent () const
 The generated event. More...
 
TrajectoryManagertrackerManager () const
 The tracker. More...
 
 ~FamosManager ()
 Destructor. More...
 

Private Attributes

int iEvent
 
bool m_Alignment
 
bool m_Calorimetry
 
int m_pRunNumber
 
bool m_pUseMagneticField
 
int m_pVerbose
 
bool m_Tracking
 
CalorimetryManagermyCalorimetry
 
PileUpSimulatormyPileUpSimulator
 
FSimEventmySimEvent
 
TrajectoryManagermyTrajectoryManager
 
double weight_
 

Detailed Description

Definition at line 30 of file FamosManager.h.

Constructor & Destructor Documentation

FamosManager::FamosManager ( edm::ParameterSet const &  p)

Constructor.

Initialize the TrajectoryManager

Definition at line 47 of file FamosManager.cc.

References edm::ParameterSet::getParameter(), m_Calorimetry, myCalorimetry, myPileUpSimulator, mySimEvent, and myTrajectoryManager.

48  : iEvent(0),
50  myCalorimetry(0),
51  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
52  m_Tracking(p.getParameter<bool>("SimulateTracking")),
53  m_Calorimetry(p.getParameter<bool>("SimulateCalorimetry")),
54  m_Alignment(p.getParameter<bool>("ApplyAlignment")),
55  m_pRunNumber(p.getUntrackedParameter<int>("RunNumber",1)),
56  m_pVerbose(p.getUntrackedParameter<int>("Verbosity",1))
57 {
58  // Initialize the FSimEvent
59  mySimEvent =
60  new FSimEvent(p.getParameter<edm::ParameterSet>("ParticleFilter"));
61 
65  p.getParameter<edm::ParameterSet>("MaterialEffects"),
66  p.getParameter<edm::ParameterSet>("TrackerSimHits"),
67  p.getParameter<edm::ParameterSet>("ActivateDecays"));
68 
69  // Initialize PileUp Producer (if requested)
71 
72  // Initialize Calorimetry Fast Simulation (if requested)
73  if ( m_Calorimetry)
74  myCalorimetry =
76  p.getParameter<edm::ParameterSet>("Calorimetry"),
77  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInECAL"),
78  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInHCAL"),
79  p.getParameter<edm::ParameterSet>("GFlash"));
80 }
bool m_pUseMagneticField
Definition: FamosManager.h:80
FSimEvent * mySimEvent
Definition: FamosManager.h:73
bool m_Alignment
Definition: FamosManager.h:83
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
bool m_Calorimetry
Definition: FamosManager.h:82
PileUpSimulator * myPileUpSimulator
Definition: FamosManager.h:75
FamosManager::~FamosManager ( )

Destructor.

Definition at line 82 of file FamosManager.cc.

References myCalorimetry, myPileUpSimulator, mySimEvent, and myTrajectoryManager.

83 {
84  if ( mySimEvent ) delete mySimEvent;
87  if ( myCalorimetry) delete myCalorimetry;
88 }
FSimEvent * mySimEvent
Definition: FamosManager.h:73
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
PileUpSimulator * myPileUpSimulator
Definition: FamosManager.h:75

Member Function Documentation

CalorimetryManager* FamosManager::calorimetryManager ( ) const
inline

The calorimeter.

Definition at line 66 of file FamosManager.h.

References myCalorimetry.

Referenced by FamosProducer::produce().

66 {return myCalorimetry;}
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
void FamosManager::reconstruct ( const HepMC::GenEvent *  evt,
const reco::GenParticleCollection particles,
const HepMC::GenEvent *  pu,
const TrackerTopology tTopo,
RandomEngineAndDistribution const *  random 
)

The real thing is done here.

Definition at line 155 of file FamosManager.cc.

References FSimEvent::fill(), iEvent, m_pRunNumber, myCalorimetry, myPileUpSimulator, mySimEvent, myTrajectoryManager, FSimEvent::nGenParts(), FSimEvent::nTracks(), FSimEvent::nVertices(), PileUpSimulator::produce(), CalorimetryManager::reconstruct(), TrajectoryManager::reconstruct(), and FSimEvent::weight().

Referenced by FamosProducer::produce().

160 {
161  // myGenEvent = evt;
162 
163  if (evt != 0 || particles != 0) {
164  iEvent++;
166 
167 
168  // Fill the event from the original generated event
169  if (evt )
170  mySimEvent->fill(*evt,id);
171 
172  else
173  mySimEvent->fill(*particles,id);
174 
175  // mySimEvent->printMCTruth(*evt);
176  /*
177  mySimEvent->print();
178  std::cout << "----------------------------------------" << std::endl;
179  */
180 
181  // Get the pileup events and add the particles to the main event
183  /*
184  mySimEvent->print();
185  std::cout << "----------------------------------------" << std::endl;
186  */
187 
188  // And propagate the particles through the detector
190  /*
191  mySimEvent->print();
192  std::cout << "========================================="
193  << std::endl
194  << std::endl;
195  */
196 
198  }
199 
200  // Should be moved to LogInfo
201  edm::LogInfo("FamosManager") << " saved : Event " << iEvent
202  << " of weight " << mySimEvent->weight()
203  << " with " << mySimEvent->nTracks()
204  << " tracks and " << mySimEvent->nVertices()
205  << " vertices, generated by "
206  << mySimEvent->nGenParts() << " particles " << std::endl;
207 }
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
FSimEvent * mySimEvent
Definition: FamosManager.h:73
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:20
TRandom random
Definition: MVATrainer.cc:138
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74
void reconstruct(RandomEngineAndDistribution const *)
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:42
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:52
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:47
void produce(const HepMC::GenEvent *pu)
Produce N minimum bias events, and add them to the FSimEvent.
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:37
PileUpSimulator * myPileUpSimulator
Definition: FamosManager.h:75
void FamosManager::reconstruct ( const reco::GenParticleCollection particles,
const TrackerTopology tTopo,
RandomEngineAndDistribution const *  random 
)

Definition at line 209 of file FamosManager.cc.

References FSimEvent::fill(), iEvent, m_pRunNumber, myCalorimetry, mySimEvent, myTrajectoryManager, CalorimetryManager::reconstruct(), and TrajectoryManager::reconstruct().

209  {
210  iEvent++;
212  mySimEvent->fill(*particles, id);
215 }
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
FSimEvent * mySimEvent
Definition: FamosManager.h:73
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:20
TRandom random
Definition: MVATrainer.cc:138
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74
void reconstruct(RandomEngineAndDistribution const *)
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
void FamosManager::setupGeometryAndField ( edm::Run const &  run,
const edm::EventSetup es 
)

Get information from the Event Setup.

Definition at line 91 of file FamosManager.cc.

References g, edm::EventSetup::get(), CalorimetryManager::getCalorimeter(), edm::EventSetup::getData(), CalorimetryManager::getHFShowerLibrary(), FastHFShowerLibrary::initHFShowerLibrary(), CaloGeometryHelper::initialize(), FBaseSimEvent::initializePdt(), TrajectoryManager::initializeRecoGeometry(), TrajectoryManager::initializeTrackerGeometry(), m_Alignment, m_pRunNumber, m_pUseMagneticField, m_Tracking, myCalorimetry, mySimEvent, myTrajectoryManager, edm::RunBase::run(), Calorimeter::setupGeometry(), Calorimeter::setupTopology(), AlCaHLTBitMon_QueryRunRegistry::string, and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by FamosProducer::beginRun().

92 {
93  // Particle data table (from Pythia)
95  es.getData(pdt);
96  mySimEvent->initializePdt(&(*pdt));
97 
98  // Initialize the full (misaligned) tracker geometry
99  // (only if tracking is requested)
100  std::string misAligned = m_Alignment ? "MisAligned" : "";
101  // 1) By default, the aligned geometry is chosen (m_Alignment = false)
102  // 2) By default, the misaligned geometry is aligned
104  es.get<TrackerDigiGeometryRecord>().get(misAligned,tracker);
106 
107  // Initialize the tracker misaligned reco geometry (always needed)
108  // By default, the misaligned geometry is aligned
109  edm::ESHandle<GeometricSearchTracker> theGeomSearchTracker;
110  es.get<TrackerRecoGeometryRecord>().get(misAligned, theGeomSearchTracker );
111 
112  // Initialize the misaligned tracker interaction geometry
113  edm::ESHandle<TrackerInteractionGeometry> theTrackerInteractionGeometry;
114  es.get<TrackerInteractionGeometryRecord>().get(misAligned, theTrackerInteractionGeometry );
115 
116  // Initialize the magnetic field
117  double bField000 = 0.;
118  if (m_pUseMagneticField) {
119  edm::ESHandle<MagneticFieldMap> theMagneticFieldMap;
120  es.get<MagneticFieldMapRecord>().get(misAligned, theMagneticFieldMap);
121  const GlobalPoint g(0.,0.,0.);
122  bField000 = theMagneticFieldMap->inTeslaZ(g);
123  myTrajectoryManager->initializeRecoGeometry(&(*theGeomSearchTracker),
124  &(*theTrackerInteractionGeometry),
125  &(*theMagneticFieldMap));
126  } else {
127  myTrajectoryManager->initializeRecoGeometry(&(*theGeomSearchTracker),
128  &(*theTrackerInteractionGeometry),
129  0);
130  bField000 = 4.0;
131  }
132  // The following should be on LogInfo
133  //std::cout << "B-field(T) at (0,0,0)(cm): " << bField000 << std::endl;
134 
135  // Initialize the calorimeter geometry
136  if ( myCalorimetry ) {
138  es.get<CaloGeometryRecord>().get(pG);
140 
141  edm::ESHandle<CaloTopology> theCaloTopology;
142  es.get<CaloTopologyRecord>().get(theCaloTopology);
143  myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology);
144  myCalorimetry->getCalorimeter()->initialize(bField000);
145 
147  }
148 
149  m_pRunNumber = run.run();
150 
151 }
bool m_pUseMagneticField
Definition: FamosManager.h:80
void initializeTrackerGeometry(const TrackerGeometry *geomTracker)
Initialize the full Tracker Geometry.
FSimEvent * mySimEvent
Definition: FamosManager.h:73
bool m_Alignment
Definition: FamosManager.h:83
void setupTopology(const CaloTopology &)
Definition: Calorimeter.cc:127
void initializeRecoGeometry(const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry, const MagneticFieldMap *aFieldMap)
Initialize the Reconstruction Geometry.
CaloGeometryHelper * getCalorimeter() const
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
void getData(T &iHolder) const
Definition: EventSetup.h:78
FastHFShowerLibrary * getHFShowerLibrary() const
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:76
void setupGeometry(const CaloGeometry &pG)
Definition: Calorimeter.cc:117
const T & get() const
Definition: EventSetup.h:55
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
void const initHFShowerLibrary(const edm::EventSetup &)
void initialize(double bField)
FSimEvent* FamosManager::simEvent ( ) const
inline

The generated event.

The simulated event

Definition at line 49 of file FamosManager.h.

References mySimEvent.

Referenced by FamosProducer::produce().

49 { return mySimEvent; }
FSimEvent * mySimEvent
Definition: FamosManager.h:73
TrajectoryManager* FamosManager::trackerManager ( ) const
inline

The tracker.

Definition at line 63 of file FamosManager.h.

References myTrajectoryManager.

Referenced by FamosProducer::produce().

63 {return myTrajectoryManager;}
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:74

Member Data Documentation

int FamosManager::iEvent
private

Definition at line 71 of file FamosManager.h.

Referenced by reconstruct().

bool FamosManager::m_Alignment
private

Definition at line 83 of file FamosManager.h.

Referenced by setupGeometryAndField().

bool FamosManager::m_Calorimetry
private

Definition at line 82 of file FamosManager.h.

Referenced by FamosManager().

int FamosManager::m_pRunNumber
private

Definition at line 85 of file FamosManager.h.

Referenced by reconstruct(), and setupGeometryAndField().

bool FamosManager::m_pUseMagneticField
private

Definition at line 80 of file FamosManager.h.

Referenced by setupGeometryAndField().

int FamosManager::m_pVerbose
private

Definition at line 86 of file FamosManager.h.

bool FamosManager::m_Tracking
private

Definition at line 81 of file FamosManager.h.

Referenced by setupGeometryAndField().

CalorimetryManager* FamosManager::myCalorimetry
private
PileUpSimulator* FamosManager::myPileUpSimulator
private

Definition at line 75 of file FamosManager.h.

Referenced by FamosManager(), reconstruct(), and ~FamosManager().

FSimEvent* FamosManager::mySimEvent
private
TrajectoryManager* FamosManager::myTrajectoryManager
private
double FamosManager::weight_
private

Definition at line 84 of file FamosManager.h.