CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
GeometricTimingDetLoader Class Reference

#include <GeometricTimingDetLoader.h>

Inheritance diagram for GeometricTimingDetLoader:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
void beginJob () override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endJob () override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 GeometricTimingDetLoader (const edm::ParameterSet &iConfig)
 
 ~GeometricTimingDetLoader () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void putOne (const GeometricTimingDet *gd, PGeometricTimingDet *pgd, int lev)
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file GeometricTimingDetLoader.h.

Constructor & Destructor Documentation

◆ GeometricTimingDetLoader()

GeometricTimingDetLoader::GeometricTimingDetLoader ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file GeometricTimingDetLoader.cc.

26  {
27  LogDebug("GeometricTimingDetLoader") << "GeometricTimingDetLoader::GeometricTimingDetLoader" << std::endl;
28 }

References LogDebug.

◆ ~GeometricTimingDetLoader()

GeometricTimingDetLoader::~GeometricTimingDetLoader ( )
override

Definition at line 30 of file GeometricTimingDetLoader.cc.

30  {
31  LogDebug("GeometricTimingDetLoader") << "GeometricTimingDetLoader::~GeometricTimingDetLoader" << std::endl;
32 }

References LogDebug.

Member Function Documentation

◆ analyze()

void GeometricTimingDetLoader::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
inlineoverridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 21 of file GeometricTimingDetLoader.h.

21 {}

◆ beginJob()

void GeometricTimingDetLoader::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 19 of file GeometricTimingDetLoader.h.

19 {}

◆ beginRun()

void GeometricTimingDetLoader::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  es 
)
override

Definition at line 34 of file GeometricTimingDetLoader.cc.

34  {
35  std::cout << "GeometricTimingDetLoader::beginJob" << std::endl;
38  if (!mydbservice.isAvailable()) {
39  std::cout << "PoolDBOutputService unavailable" << std::endl;
40  return;
41  }
44  es.get<IdealGeometryRecord>().get(pDD);
45  es.get<IdealGeometryRecord>().get(rDD);
46  const GeometricTimingDet* tracker = &(*rDD);
47 
48  // so now I have the tracker itself. loop over all its components to store them.
49  putOne(tracker, pgd, 0);
50  std::vector<const GeometricTimingDet*> tc = tracker->components();
51  std::cout << "Tracker has " << tc.size() << " components." << std::endl; //, lets go through them." << std::endl;
52  std::vector<const GeometricTimingDet*>::const_iterator git = tc.begin();
53  std::vector<const GeometricTimingDet*>::const_iterator egit = tc.end();
54  int count = 0;
55  int lev = 1;
56  for (; git != egit; ++git) { // one level below "tracker"
57  putOne(*git, pgd, lev);
58  std::vector<const GeometricTimingDet*> inone = (*git)->components();
59  // << ctste.name((*git)->type())
60  // std::cout << lev << " type " << (*git)->type() << " " << int((*git)->geographicalId()) << std::endl; // << " has " << inone.size() << " components." << std::endl;
61  if (inone.empty())
62  ++count;
63  std::vector<const GeometricTimingDet*>::const_iterator git2 = inone.begin();
64  std::vector<const GeometricTimingDet*>::const_iterator egit2 = inone.end();
65  ++lev;
66  for (; git2 != egit2; ++git2) { // level 2
67  putOne(*git2, pgd, lev);
68  std::vector<const GeometricTimingDet*> intwo = (*git2)->components();
69  // std::cout << lev << "\ttype " << (*git2)->type() << " " << int((*git2)->geographicalId()) << std::endl; // << " has " << intwo.size() << " components." << std::endl;
70  if (intwo.empty())
71  ++count;
72  std::vector<const GeometricTimingDet*>::const_iterator git3 = intwo.begin();
73  std::vector<const GeometricTimingDet*>::const_iterator egit3 = intwo.end();
74  ++lev;
75  for (; git3 != egit3; ++git3) { // level 3
76  putOne(*git3, pgd, lev);
77  std::vector<const GeometricTimingDet*> inthree = (*git3)->components();
78  // std::cout << lev << "\t\ttype " << (*git3)->type() << " " << int((*git3)->geographicalId()) << std::endl; // << " has " << inthree.size() << " components." << std::endl;
79  if (inthree.empty())
80  ++count;
81  std::vector<const GeometricTimingDet*>::const_iterator git4 = inthree.begin();
82  std::vector<const GeometricTimingDet*>::const_iterator egit4 = inthree.end();
83  ++lev;
84  for (; git4 != egit4; ++git4) { //level 4
85  putOne(*git4, pgd, lev);
86  std::vector<const GeometricTimingDet*> infour = (*git4)->components();
87  // std::cout << lev << "\t\t\ttype " << (*git4)->type() << " " << int((*git4)->geographicalId()) << std::endl; // << " has " << infour.size() << " components." << std::endl;
88  if (infour.empty())
89  ++count;
90  std::vector<const GeometricTimingDet*>::const_iterator git5 = infour.begin();
91  std::vector<const GeometricTimingDet*>::const_iterator egit5 = infour.end();
92  ++lev;
93  for (; git5 != egit5; ++git5) { // level 5
94  putOne(*git5, pgd, lev);
95  std::vector<const GeometricTimingDet*> infive = (*git5)->components();
96  // std::cout << lev << "\t\t\t\ttype " << (*git5)->type() << " " << int((*git5)->geographicalId()) << std::endl; // << " has " << infive.size() << " components." << std::endl;
97  if (infive.empty())
98  ++count;
99  std::vector<const GeometricTimingDet*>::const_iterator git6 = infive.begin();
100  std::vector<const GeometricTimingDet*>::const_iterator egit6 = infive.end();
101  ++lev;
102  for (; git6 != egit6; ++git6) { //level 6
103  putOne(*git6, pgd, lev);
104  std::vector<const GeometricTimingDet*> insix = (*git6)->components();
105  // std::cout << lev << "\t\t\t\t\ttype " << (*git6)->type() << " " << int((*git6)->geographicalId()) << std::endl; // << " has " << insix.size() << " components." << std::endl;
106  if (insix.empty())
107  ++count;
108  } // level 6
109  --lev;
110  } // level 5
111  --lev;
112  } // level 4
113  --lev;
114  } //level 3
115  --lev;
116  } // level 2
117  --lev;
118  }
119  std::vector<const GeometricTimingDet*> modules = tracker->deepComponents();
120  std::cout << " No. of Tracker components \"deepComponents\" = " << modules.size() << std::endl;
121  std::cout << " Counted # of lowest \"leaves\" = " << count << std::endl;
122  if (mydbservice->isNewTagRequest("PGeometricTimingDetRcd")) {
123  mydbservice->createNewIOV<PGeometricTimingDet>(
124  pgd, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PGeometricTimingDetRcd");
125  } else {
126  std::cout << "PGeometricTimingDetRcd Tag is already present." << std::endl;
127  }
128 }

References cond::service::PoolDBOutputService::beginOfTime(), KineDebug3::count(), gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), edm::EventSetup::get(), get, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), putOne(), and PbPb_ZMuSkimMuonDPG_cff::tracker.

◆ endJob()

void GeometricTimingDetLoader::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 23 of file GeometricTimingDetLoader.h.

23 {}

◆ endRun()

void GeometricTimingDetLoader::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverride

Definition at line 22 of file GeometricTimingDetLoader.h.

22 {}

◆ putOne()

void GeometricTimingDetLoader::putOne ( const GeometricTimingDet gd,
PGeometricTimingDet pgd,
int  lev 
)
private

Definition at line 130 of file GeometricTimingDetLoader.cc.

130  {
131  // std::cout << "putting name: " << gd->name().name();
132  // std::cout << " gid: " << gd->geographicalID();
133  // std::cout << " type: " << gd->type() << std::endl;
134  // std::cout << "shape = " << gd->shape()<<"; name = "<<gd->name().name()<<"; parameter number = "<<gd->params().size()<<std::endl;
136  const DDTranslation& tran = gd->translation();
137  const DDRotationMatrix& rot = gd->rotation();
138  DD3Vector x, y, z;
139  rot.GetComponents(x, y, z);
140  item.name_ = gd->name();
141  item.level_ = lev;
142  item.x_ = tran.X();
143  item.y_ = tran.Y();
144  item.z_ = tran.Z();
145  item.phi_ = gd->phi();
146  item.rho_ = gd->rho();
147  item.a11_ = x.X();
148  item.a12_ = y.X();
149  item.a13_ = z.X();
150  item.a21_ = x.Y();
151  item.a22_ = y.Y();
152  item.a23_ = z.Y();
153  item.a31_ = x.Z();
154  item.a32_ = y.Z();
155  item.a33_ = z.Z();
156  item.shape_ = static_cast<int>(gd->shape());
157  item.type_ = gd->type();
158  if (gd->shape() == DDSolidShape::ddbox) {
159  item.params_0 = gd->params()[0];
160  item.params_1 = gd->params()[1];
161  item.params_2 = gd->params()[2];
162  item.params_3 = 0;
163  item.params_4 = 0;
164  item.params_5 = 0;
165  item.params_6 = 0;
166  item.params_7 = 0;
167  item.params_8 = 0;
168  item.params_9 = 0;
169  item.params_10 = 0;
170  } else if (gd->shape() == DDSolidShape::ddtrap) {
171  item.params_0 = gd->params()[0];
172  item.params_1 = gd->params()[1];
173  item.params_2 = gd->params()[2];
174  item.params_3 = gd->params()[3];
175  item.params_4 = gd->params()[4];
176  item.params_5 = gd->params()[5];
177  item.params_6 = gd->params()[6];
178  item.params_7 = gd->params()[7];
179  item.params_8 = gd->params()[8];
180  item.params_9 = gd->params()[9];
181  item.params_10 = gd->params()[10];
182  } else {
183  item.params_0 = 0;
184  item.params_1 = 0;
185  item.params_2 = 0;
186  item.params_3 = 0;
187  item.params_4 = 0;
188  item.params_5 = 0;
189  item.params_6 = 0;
190  item.params_7 = 0;
191  item.params_8 = 0;
192  item.params_9 = 0;
193  item.params_10 = 0;
194  }
195  item.geographicalID_ = gd->geographicalID();
196  // FIXME: These are moved to PGeometricTimingDetExtra:
197  //item.volume_ = gd->volume();
198  //item.density_ = gd->density();
199  //item.weight_ = gd->weight();
200  //item.copy_ = gd->copyno();
201  //item.material_ = gd->material();
202  item.radLength_ = gd->radLength();
203  item.xi_ = gd->xi();
204  item.pixROCRows_ = gd->pixROCRows();
205  item.pixROCCols_ = gd->pixROCCols();
206  item.pixROCx_ = gd->pixROCx();
207  item.pixROCy_ = gd->pixROCy();
208  item.stereo_ = gd->stereo();
209  item.siliconAPVNum_ = gd->siliconAPVNum();
210  pgd->pgeomdets_.push_back(item);
211 }

References ddbox, ddtrap, GeometricTimingDet::geographicalID(), B2GTnPMonitor_cfi::item, GeometricTimingDet::name(), GeometricTimingDet::params(), PGeometricTimingDet::pgeomdets_, GeometricTimingDet::phi(), GeometricTimingDet::pixROCCols(), GeometricTimingDet::pixROCRows(), GeometricTimingDet::pixROCx(), GeometricTimingDet::pixROCy(), GeometricTimingDet::radLength(), GeometricTimingDet::rho(), makeMuonMisalignmentScenario::rot, GeometricTimingDet::rotation(), GeometricTimingDet::shape(), GeometricTimingDet::siliconAPVNum(), GeometricTimingDet::stereo(), GeometricTimingDet::translation(), GeometricTimingDet::type(), x, GeometricTimingDet::xi(), y, and z.

Referenced by beginRun().

PGeometricTimingDet::Item
Definition: PGeometricTimingDet.h:14
DDAxes::y
GeometricTimingDetLoader::putOne
void putOne(const GeometricTimingDet *gd, PGeometricTimingDet *pgd, int lev)
Definition: GeometricTimingDetLoader.cc:130
DDSolidShape::ddtrap
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
GeometricTimingDet::type
GeometricTimingEnumType type() const
Definition: GeometricTimingDet.h:104
modules
Definition: ZHLTMatchFilter.cc:17
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GeometricTimingDet::name
std::string const & name() const
Definition: GeometricTimingDet.h:105
DDAxes::x
GeometricTimingDet::pixROCx
double pixROCx() const
Definition: GeometricTimingDet.h:158
GeometricTimingDet::siliconAPVNum
double siliconAPVNum() const
Definition: GeometricTimingDet.h:165
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
GeometricTimingDet::params
std::vector< double > const & params() const
Definition: GeometricTimingDet.h:112
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:110
GeometricTimingDet::pixROCy
double pixROCy() const
Definition: GeometricTimingDet.h:159
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDAxes::z
edm::ESHandle
Definition: DTSurvey.h:22
GeometricTimingDet::radLength
double radLength() const
Definition: GeometricTimingDet.h:151
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
GeometricTimingDet::translation
Translation const & translation() const
Definition: GeometricTimingDet.h:99
GeometricTimingDet::pixROCRows
double pixROCRows() const
Definition: GeometricTimingDet.h:156
PGeometricTimingDet::pgeomdets_
std::vector< Item > pgeomdets_
Definition: PGeometricTimingDet.h:50
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
PGeometricTimingDet
Definition: PGeometricTimingDet.h:9
edm::Service< cond::service::PoolDBOutputService >
GeometricTimingDet
Definition: GeometricTimingDet.h:28
GeometricTimingDet::stereo
bool stereo() const
Definition: GeometricTimingDet.h:164
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
get
#define get
GeometricTimingDet::phi
double phi() const
Definition: GeometricTimingDet.h:100
GeometricTimingDet::geographicalID
DetId geographicalID() const
Definition: GeometricTimingDet.h:134
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:185
GeometricTimingDet::pixROCCols
double pixROCCols() const
Definition: GeometricTimingDet.h:157
DDSolidShape::ddbox
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:100
GeometricTimingDet::shape
DDSolidShape const & shape() const
Definition: GeometricTimingDet.h:103
GeometricTimingDet::rotation
RotationMatrix const & rotation() const
Definition: GeometricTimingDet.h:98
GeometricTimingDet::rho
double rho() const
Definition: GeometricTimingDet.h:101
GeometricTimingDet::xi
double xi() const
Definition: GeometricTimingDet.h:152
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27