CMS 3D CMS Logo

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 TrackerTopology *tTopo, RandomEngineAndDistribution const *)
 The real thing is done here. More...
 
void setupGeometryAndField (edm::Run const &run, const edm::EventSetup &es)
 Get information from the Event Setup. More...
 
FSimEventsimEvent () const
 The simulated 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
 
FSimEventmySimEvent
 
TrajectoryManagermyTrajectoryManager
 
double weight_
 

Detailed Description

Definition at line 29 of file FamosManager.h.

Constructor & Destructor Documentation

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

Constructor.

Initialize the TrajectoryManager

Definition at line 45 of file FamosManager.cc.

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

46  : iEvent(0),
47  myCalorimetry(nullptr),
48  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
49  m_Tracking(p.getParameter<bool>("SimulateTracking")),
50  m_Calorimetry(p.getParameter<bool>("SimulateCalorimetry")),
51  m_Alignment(p.getParameter<bool>("ApplyAlignment")),
52  m_pRunNumber(p.getUntrackedParameter<int>("RunNumber",1)),
53  m_pVerbose(p.getUntrackedParameter<int>("Verbosity",1))
54 {
55  // Initialize the FSimEvent
56  mySimEvent =
57  new FSimEvent(p.getParameter<edm::ParameterSet>("ParticleFilter"));
58 
62  p.getParameter<edm::ParameterSet>("MaterialEffects"),
63  p.getParameter<edm::ParameterSet>("TrackerSimHits"),
64  p.getParameter<edm::ParameterSet>("ActivateDecays"));
65 
66  // Initialize Calorimetry Fast Simulation (if requested)
67  if ( m_Calorimetry)
68  myCalorimetry =
70  p.getParameter<edm::ParameterSet>("Calorimetry"),
71  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInECAL"),
72  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInHCAL"),
73  p.getParameter<edm::ParameterSet>("GFlash"));
74 }
bool m_pUseMagneticField
Definition: FamosManager.h:68
FSimEvent * mySimEvent
Definition: FamosManager.h:62
bool m_Alignment
Definition: FamosManager.h:71
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:63
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:64
bool m_Calorimetry
Definition: FamosManager.h:70
FamosManager::~FamosManager ( )

Destructor.

Definition at line 76 of file FamosManager.cc.

References myCalorimetry, mySimEvent, and myTrajectoryManager.

77 {
78  if ( mySimEvent ) delete mySimEvent;
80  if ( myCalorimetry) delete myCalorimetry;
81 }
FSimEvent * mySimEvent
Definition: FamosManager.h:62
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:63
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:64

Member Function Documentation

CalorimetryManager* FamosManager::calorimetryManager ( ) const
inline

The calorimeter.

Definition at line 55 of file FamosManager.h.

Referenced by FamosProducer::produce().

55 {return myCalorimetry;}
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:64
void FamosManager::reconstruct ( const HepMC::GenEvent evt,
const TrackerTopology tTopo,
RandomEngineAndDistribution const *  random 
)

The real thing is done here.

Definition at line 148 of file FamosManager.cc.

References FSimEvent::fill(), triggerObjects_cff::id, iEvent, m_pRunNumber, myCalorimetry, mySimEvent, myTrajectoryManager, FSimEvent::nGenParts(), FSimEvent::nTracks(), FSimEvent::nVertices(), CalorimetryManager::reconstruct(), TrajectoryManager::reconstruct(), mitigatedMETSequence_cff::U, and FSimEvent::weight().

Referenced by FamosProducer::produce().

151 {
152  // myGenEvent = evt;
153 
154  iEvent++;
156 
157 
158  // Fill the event from the original generated event
159  mySimEvent->fill(*evt,id);
160 
161  // And propagate the particles through the detector
163 
165 
166  edm::LogInfo("FamosManager") << " saved : Event " << iEvent
167  << " of weight " << mySimEvent->weight()
168  << " with " << mySimEvent->nTracks()
169  << " tracks and " << mySimEvent->nVertices()
170  << " vertices, generated by "
171  << mySimEvent->nGenParts() << " particles " << std::endl;
172 }
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
FSimEvent * mySimEvent
Definition: FamosManager.h:62
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:14
TRandom random
Definition: MVATrainer.cc:138
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:63
void reconstruct(RandomEngineAndDistribution const *)
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:64
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:36
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:46
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:41
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:31
void FamosManager::setupGeometryAndField ( edm::Run const &  run,
const edm::EventSetup es 
)

Get information from the Event Setup.

Definition at line 84 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(), MagneticFieldMap::inTeslaZ(), m_Alignment, m_pRunNumber, m_pUseMagneticField, m_Tracking, myCalorimetry, mySimEvent, myTrajectoryManager, edm::RunBase::run(), Calorimeter::setupGeometry(), Calorimeter::setupTopology(), AlCaHLTBitMon_QueryRunRegistry::string, and trackingTruthProducer_cfi::tracker.

Referenced by FamosProducer::beginRun().

85 {
86  // Particle data table (from Pythia)
88  es.getData(pdt);
89  mySimEvent->initializePdt(&(*pdt));
90 
91  // Initialize the full (misaligned) tracker geometry
92  // (only if tracking is requested)
93  std::string misAligned = m_Alignment ? "MisAligned" : "";
94  // 1) By default, the aligned geometry is chosen (m_Alignment = false)
95  // 2) By default, the misaligned geometry is aligned
97  es.get<TrackerDigiGeometryRecord>().get(misAligned,tracker);
99 
100  // Initialize the tracker misaligned reco geometry (always needed)
101  // By default, the misaligned geometry is aligned
102  edm::ESHandle<GeometricSearchTracker> theGeomSearchTracker;
103  es.get<TrackerRecoGeometryRecord>().get(misAligned, theGeomSearchTracker );
104 
105  // Initialize the misaligned tracker interaction geometry
106  edm::ESHandle<TrackerInteractionGeometry> theTrackerInteractionGeometry;
107  es.get<TrackerInteractionGeometryRecord>().get(misAligned, theTrackerInteractionGeometry );
108 
109  // Initialize the magnetic field
110  double bField000 = 0.;
111  if (m_pUseMagneticField) {
112  edm::ESHandle<MagneticFieldMap> theMagneticFieldMap;
113  es.get<MagneticFieldMapRecord>().get(misAligned, theMagneticFieldMap);
114  const GlobalPoint g(0.,0.,0.);
115  bField000 = theMagneticFieldMap->inTeslaZ(g);
116  myTrajectoryManager->initializeRecoGeometry(&(*theGeomSearchTracker),
117  &(*theTrackerInteractionGeometry),
118  &(*theMagneticFieldMap));
119  } else {
120  myTrajectoryManager->initializeRecoGeometry(&(*theGeomSearchTracker),
121  &(*theTrackerInteractionGeometry),
122  nullptr);
123  bField000 = 4.0;
124  }
125  // The following should be on LogInfo
126  //std::cout << "B-field(T) at (0,0,0)(cm): " << bField000 << std::endl;
127 
128  // Initialize the calorimeter geometry
129  if ( myCalorimetry ) {
131  es.get<CaloGeometryRecord>().get(pG);
133 
134  edm::ESHandle<CaloTopology> theCaloTopology;
135  es.get<CaloTopologyRecord>().get(theCaloTopology);
136  myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology);
137  myCalorimetry->getCalorimeter()->initialize(bField000);
138 
140  }
141 
142  m_pRunNumber = run.run();
143 
144 }
bool m_pUseMagneticField
Definition: FamosManager.h:68
void initializeTrackerGeometry(const TrackerGeometry *geomTracker)
Initialize the full Tracker Geometry.
double inTeslaZ(const GlobalPoint &) const
FSimEvent * mySimEvent
Definition: FamosManager.h:62
bool m_Alignment
Definition: FamosManager.h:71
void setupTopology(const CaloTopology &)
Definition: Calorimeter.cc:128
void initializeRecoGeometry(const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry, const MagneticFieldMap *aFieldMap)
Initialize the Reconstruction Geometry.
CaloGeometryHelper * getCalorimeter() const
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:63
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
bool getData(T &iHolder) const
Definition: EventSetup.h:111
FastHFShowerLibrary * getHFShowerLibrary() const
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:64
void setupGeometry(const CaloGeometry &pG)
Definition: Calorimeter.cc:118
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
T get() const
Definition: EventSetup.h:71
void const initHFShowerLibrary(const edm::EventSetup &)
void initialize(double bField)
FSimEvent* FamosManager::simEvent ( ) const
inline

The simulated event.

Definition at line 44 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

The tracker.

Definition at line 52 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

Member Data Documentation

int FamosManager::iEvent
private

Definition at line 60 of file FamosManager.h.

Referenced by reconstruct().

bool FamosManager::m_Alignment
private

Definition at line 71 of file FamosManager.h.

Referenced by setupGeometryAndField().

bool FamosManager::m_Calorimetry
private

Definition at line 70 of file FamosManager.h.

Referenced by FamosManager().

int FamosManager::m_pRunNumber
private

Definition at line 73 of file FamosManager.h.

Referenced by reconstruct(), and setupGeometryAndField().

bool FamosManager::m_pUseMagneticField
private

Definition at line 68 of file FamosManager.h.

Referenced by setupGeometryAndField().

int FamosManager::m_pVerbose
private

Definition at line 74 of file FamosManager.h.

bool FamosManager::m_Tracking
private

Definition at line 69 of file FamosManager.h.

Referenced by setupGeometryAndField().

CalorimetryManager* FamosManager::myCalorimetry
private

Definition at line 64 of file FamosManager.h.

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

FSimEvent* FamosManager::mySimEvent
private

Definition at line 62 of file FamosManager.h.

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

TrajectoryManager* FamosManager::myTrajectoryManager
private

Definition at line 63 of file FamosManager.h.

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

double FamosManager::weight_
private

Definition at line 72 of file FamosManager.h.