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 30 of file FamosManager.h.

Constructor & Destructor Documentation

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

Constructor.

Initialize the TrajectoryManager

Definition at line 46 of file FamosManager.cc.

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

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

Destructor.

Definition at line 77 of file FamosManager.cc.

References myCalorimetry, mySimEvent, and myTrajectoryManager.

78 {
79  if ( mySimEvent ) delete mySimEvent;
81  if ( myCalorimetry) delete myCalorimetry;
82 }
FSimEvent * mySimEvent
Definition: FamosManager.h:63
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:64
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:65

Member Function Documentation

CalorimetryManager* FamosManager::calorimetryManager ( ) const
inline

The calorimeter.

Definition at line 56 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

The real thing is done here.

Definition at line 149 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().

152 {
153  // myGenEvent = evt;
154 
155  iEvent++;
157 
158 
159  // Fill the event from the original generated event
160  mySimEvent->fill(*evt,id);
161 
162  // And propagate the particles through the detector
164 
166 
167  edm::LogInfo("FamosManager") << " saved : Event " << iEvent
168  << " of weight " << mySimEvent->weight()
169  << " with " << mySimEvent->nTracks()
170  << " tracks and " << mySimEvent->nVertices()
171  << " vertices, generated by "
172  << mySimEvent->nGenParts() << " particles " << std::endl;
173 }
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
FSimEvent * mySimEvent
Definition: FamosManager.h:63
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:64
void reconstruct(RandomEngineAndDistribution const *)
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:65
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 85 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 mixOne_simraw_on_sim_cfi::tracker.

Referenced by FamosProducer::beginRun().

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

Definition at line 45 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

The tracker.

Definition at line 53 of file FamosManager.h.

Referenced by FamosProducer::produce().

53 {return myTrajectoryManager;}
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:64

Member Data Documentation

int FamosManager::iEvent
private

Definition at line 61 of file FamosManager.h.

Referenced by reconstruct().

bool FamosManager::m_Alignment
private

Definition at line 72 of file FamosManager.h.

Referenced by setupGeometryAndField().

bool FamosManager::m_Calorimetry
private

Definition at line 71 of file FamosManager.h.

Referenced by FamosManager().

int FamosManager::m_pRunNumber
private

Definition at line 74 of file FamosManager.h.

Referenced by reconstruct(), and setupGeometryAndField().

bool FamosManager::m_pUseMagneticField
private

Definition at line 69 of file FamosManager.h.

Referenced by setupGeometryAndField().

int FamosManager::m_pVerbose
private

Definition at line 75 of file FamosManager.h.

bool FamosManager::m_Tracking
private

Definition at line 70 of file FamosManager.h.

Referenced by setupGeometryAndField().

CalorimetryManager* FamosManager::myCalorimetry
private

Definition at line 65 of file FamosManager.h.

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

FSimEvent* FamosManager::mySimEvent
private

Definition at line 63 of file FamosManager.h.

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

TrajectoryManager* FamosManager::myTrajectoryManager
private

Definition at line 64 of file FamosManager.h.

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

double FamosManager::weight_
private

Definition at line 73 of file FamosManager.h.