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  // Initialize the FSimEvent
55  mySimEvent = new FSimEvent(p.getParameter<edm::ParameterSet>("ParticleFilter"));
56 
59  p.getParameter<edm::ParameterSet>("MaterialEffects"),
60  p.getParameter<edm::ParameterSet>("TrackerSimHits"),
61  p.getParameter<edm::ParameterSet>("ActivateDecays"));
62 
63  // Initialize Calorimetry Fast Simulation (if requested)
64  if (m_Calorimetry)
66  p.getParameter<edm::ParameterSet>("Calorimetry"),
67  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInECAL"),
68  p.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInHCAL"),
69  p.getParameter<edm::ParameterSet>("GFlash"));
70 }
bool m_pUseMagneticField
Definition: FamosManager.h:60
FSimEvent * mySimEvent
Definition: FamosManager.h:55
bool m_Alignment
Definition: FamosManager.h:63
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:56
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:57
bool m_Calorimetry
Definition: FamosManager.h:62
FamosManager::~FamosManager ( )

Destructor.

Definition at line 72 of file FamosManager.cc.

References myCalorimetry, mySimEvent, and myTrajectoryManager.

72  {
73  if (mySimEvent)
74  delete mySimEvent;
76  delete myTrajectoryManager;
77  if (myCalorimetry)
78  delete myCalorimetry;
79 }
FSimEvent * mySimEvent
Definition: FamosManager.h:55
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:56
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:57

Member Function Documentation

CalorimetryManager* FamosManager::calorimetryManager ( ) const
inline

The calorimeter.

Definition at line 50 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

The real thing is done here.

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

141  {
142  // myGenEvent = evt;
143 
144  iEvent++;
146 
147  // Fill the event from the original generated event
148  mySimEvent->fill(*evt, id);
149 
150  // And propagate the particles through the detector
151  myTrajectoryManager->reconstruct(tTopo, random);
152 
153  if (myCalorimetry)
154  myCalorimetry->reconstruct(random);
155 
156  edm::LogInfo("FamosManager") << " saved : Event " << iEvent << " of weight " << mySimEvent->weight() << " with "
157  << mySimEvent->nTracks() << " tracks and " << mySimEvent->nVertices()
158  << " vertices, generated by " << mySimEvent->nGenParts() << " particles " << std::endl;
159 }
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
FSimEvent * mySimEvent
Definition: FamosManager.h:55
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:10
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:56
void reconstruct(RandomEngineAndDistribution const *)
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:57
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:24
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:28
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:26
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:22
void FamosManager::setupGeometryAndField ( edm::Run const &  run,
const edm::EventSetup es 
)

Get information from the Event Setup.

Definition at line 81 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 PbPb_ZMuSkimMuonDPG_cff::tracker.

Referenced by FamosProducer::beginRun().

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

The simulated event.

Definition at line 41 of file FamosManager.h.

Referenced by FamosProducer::produce().

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

The tracker.

Definition at line 47 of file FamosManager.h.

Referenced by FamosProducer::produce().

47 { return myTrajectoryManager; }
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:56

Member Data Documentation

int FamosManager::iEvent
private

Definition at line 53 of file FamosManager.h.

Referenced by reconstruct().

bool FamosManager::m_Alignment
private

Definition at line 63 of file FamosManager.h.

Referenced by setupGeometryAndField().

bool FamosManager::m_Calorimetry
private

Definition at line 62 of file FamosManager.h.

Referenced by FamosManager().

int FamosManager::m_pRunNumber
private

Definition at line 65 of file FamosManager.h.

Referenced by reconstruct(), and setupGeometryAndField().

bool FamosManager::m_pUseMagneticField
private

Definition at line 60 of file FamosManager.h.

Referenced by setupGeometryAndField().

int FamosManager::m_pVerbose
private

Definition at line 66 of file FamosManager.h.

bool FamosManager::m_Tracking
private

Definition at line 61 of file FamosManager.h.

Referenced by setupGeometryAndField().

CalorimetryManager* FamosManager::myCalorimetry
private

Definition at line 57 of file FamosManager.h.

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

FSimEvent* FamosManager::mySimEvent
private

Definition at line 55 of file FamosManager.h.

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

TrajectoryManager* FamosManager::myTrajectoryManager
private

Definition at line 56 of file FamosManager.h.

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

double FamosManager::weight_
private

Definition at line 64 of file FamosManager.h.