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::FamosManager ( edm::ParameterSet const &  p)

Constructor.

Initialize the TrajectoryManager

Definition at line 45 of file FamosManager.cc.

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 }

References m_Calorimetry, myCalorimetry, mySimEvent, myTrajectoryManager, and AlCaHLTBitMon_ParallelJobs::p.

◆ ~FamosManager()

FamosManager::~FamosManager ( )

Destructor.

Definition at line 72 of file FamosManager.cc.

72  {
73  if (mySimEvent)
74  delete mySimEvent;
76  delete myTrajectoryManager;
77  if (myCalorimetry)
78  delete myCalorimetry;
79 }

References myCalorimetry, mySimEvent, and myTrajectoryManager.

Member Function Documentation

◆ calorimetryManager()

CalorimetryManager* FamosManager::calorimetryManager ( ) const
inline

The calorimeter.

Definition at line 50 of file FamosManager.h.

50 { return myCalorimetry; }

References myCalorimetry.

Referenced by FamosProducer::produce().

◆ reconstruct()

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.

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 }

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().

◆ setupGeometryAndField()

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.

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 }

References g, edm::EventSetup::get(), 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, writedatasetfile::run, Calorimeter::setupGeometry(), Calorimeter::setupTopology(), AlCaHLTBitMon_QueryRunRegistry::string, and PbPb_ZMuSkimMuonDPG_cff::tracker.

Referenced by FamosProducer::beginRun().

◆ simEvent()

FSimEvent* FamosManager::simEvent ( ) const
inline

The simulated event.

Definition at line 41 of file FamosManager.h.

41 { return mySimEvent; }

References mySimEvent.

Referenced by FamosProducer::produce().

◆ trackerManager()

TrajectoryManager* FamosManager::trackerManager ( ) const
inline

The tracker.

Definition at line 47 of file FamosManager.h.

47 { return myTrajectoryManager; }

References myTrajectoryManager.

Referenced by FamosProducer::produce().

Member Data Documentation

◆ iEvent

int FamosManager::iEvent
private

Definition at line 53 of file FamosManager.h.

Referenced by reconstruct().

◆ m_Alignment

bool FamosManager::m_Alignment
private

Definition at line 63 of file FamosManager.h.

Referenced by setupGeometryAndField().

◆ m_Calorimetry

bool FamosManager::m_Calorimetry
private

Definition at line 62 of file FamosManager.h.

Referenced by FamosManager().

◆ m_pRunNumber

int FamosManager::m_pRunNumber
private

Definition at line 65 of file FamosManager.h.

Referenced by reconstruct(), and setupGeometryAndField().

◆ m_pUseMagneticField

bool FamosManager::m_pUseMagneticField
private

Definition at line 60 of file FamosManager.h.

Referenced by setupGeometryAndField().

◆ m_pVerbose

int FamosManager::m_pVerbose
private

Definition at line 66 of file FamosManager.h.

◆ m_Tracking

bool FamosManager::m_Tracking
private

Definition at line 61 of file FamosManager.h.

Referenced by setupGeometryAndField().

◆ myCalorimetry

CalorimetryManager* FamosManager::myCalorimetry
private

◆ mySimEvent

FSimEvent* FamosManager::mySimEvent
private

◆ myTrajectoryManager

TrajectoryManager* FamosManager::myTrajectoryManager
private

◆ weight_

double FamosManager::weight_
private

Definition at line 64 of file FamosManager.h.

TrajectoryManager::reconstruct
void reconstruct(const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
Does the real job.
Definition: TrajectoryManager.cc:129
FSimEvent
Definition: FSimEvent.h:29
TrajectoryManager::initializeTrackerGeometry
void initializeTrackerGeometry(const TrackerGeometry *geomTracker)
Initialize the full Tracker Geometry.
Definition: TrajectoryManager.cc:112
Calorimeter::setupTopology
void setupTopology(const CaloTopology &)
Definition: Calorimeter.cc:127
TrajectoryManager::initializeRecoGeometry
void initializeRecoGeometry(const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry, const MagneticFieldMap *aFieldMap)
Initialize the Reconstruction Geometry.
Definition: TrajectoryManager.cc:97
FBaseSimEvent::initializePdt
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
Definition: FBaseSimEvent.cc:80
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
TrackerInteractionGeometryRecord
Definition: TrackerInteractionGeometryRecord.h:26
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MagneticFieldMap::inTeslaZ
double inTeslaZ(const GlobalPoint &) const
Definition: MagneticFieldMap.cc:91
edm::LogInfo
Definition: MessageLogger.h:254
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:11
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
FSimEvent::nTracks
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:24
FamosManager::m_Alignment
bool m_Alignment
Definition: FamosManager.h:63
CaloGeometryHelper::initialize
void initialize(double bField)
Definition: CaloGeometryHelper.cc:38
FamosManager::m_Tracking
bool m_Tracking
Definition: FamosManager.h:61
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
FamosManager::mySimEvent
FSimEvent * mySimEvent
Definition: FamosManager.h:55
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< HepPDT::ParticleDataTable >
Point3DBase< float, GlobalTag >
Calorimeter::setupGeometry
void setupGeometry(const CaloGeometry &pG)
Definition: Calorimeter.cc:117
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
FamosManager::myTrajectoryManager
TrajectoryManager * myTrajectoryManager
Definition: FamosManager.h:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FamosManager::m_pRunNumber
int m_pRunNumber
Definition: FamosManager.h:65
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
edm::ParameterSet
Definition: ParameterSet.h:36
CalorimetryManager
Definition: CalorimetryManager.h:45
CalorimetryManager::getHFShowerLibrary
FastHFShowerLibrary * getHFShowerLibrary() const
Definition: CalorimetryManager.h:64
FamosManager::m_pVerbose
int m_pVerbose
Definition: FamosManager.h:66
FamosManager::m_Calorimetry
bool m_Calorimetry
Definition: FamosManager.h:62
FSimEvent::fill
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:10
MagneticFieldMapRecord
Definition: MagneticFieldMapRecord.h:27
FamosManager::iEvent
int iEvent
Definition: FamosManager.h:53
get
#define get
CalorimetryManager::reconstruct
void reconstruct(RandomEngineAndDistribution const *)
Definition: CalorimetryManager.cc:146
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:113
FamosManager::myCalorimetry
CalorimetryManager * myCalorimetry
Definition: FamosManager.h:57
FSimEvent::weight
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:22
writedatasetfile.run
run
Definition: writedatasetfile.py:27
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
FamosManager::m_pUseMagneticField
bool m_pUseMagneticField
Definition: FamosManager.h:60
FSimEvent::nVertices
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:26
FSimEvent::nGenParts
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:28
TrajectoryManager
Definition: TrajectoryManager.h:59
edm::EventID
Definition: EventID.h:31
CalorimetryManager::getCalorimeter
CaloGeometryHelper * getCalorimeter() const
Definition: CalorimetryManager.h:61
g
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
FastHFShowerLibrary::initHFShowerLibrary
const void initHFShowerLibrary(const edm::EventSetup &)
Definition: FastHFShowerLibrary.cc:47