test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PGeometricDetBuilder Class Reference

#include <PGeometricDetBuilder.h>

Inheritance diagram for PGeometricDetBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
 PGeometricDetBuilder (const edm::ParameterSet &iConfig)
 
void putOne (const GeometricDet *gd, PGeometricDet *pgd, int lev)
 
 ~PGeometricDetBuilder ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file PGeometricDetBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file PGeometricDetBuilder.cc.

27 {
28 }
PGeometricDetBuilder::~PGeometricDetBuilder ( )

Definition at line 30 of file PGeometricDetBuilder.cc.

31 {
32 }

Member Function Documentation

virtual void PGeometricDetBuilder::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 20 of file PGeometricDetBuilder.h.

20 {}
void PGeometricDetBuilder::beginRun ( const edm::Run ,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 35 of file PGeometricDetBuilder.cc.

References cond::service::PoolDBOutputService::beginOfTime(), GeometricDet::components(), prof2calltree::count, cond::service::PoolDBOutputService::createNewIOV(), GeometricDet::deepComponents(), cond::service::PoolDBOutputService::endOfTime(), edm::EventSetup::get(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), edmConvertToStreamModule::modules, putOne(), and patCandidatesForDimuonsSequences_cff::tracker.

36 {
37  PGeometricDet* pgd = new PGeometricDet;
39  if( !mydbservice.isAvailable() ){
40  edm::LogError("PGeometricDetBuilder")<<"PoolDBOutputService unavailable";
41  return;
42  }
45  es.get<IdealGeometryRecord>().get( pDD );
46  es.get<IdealGeometryRecord>().get( rDD );
47  const GeometricDet* tracker = &(*rDD);
48 
49  // so now I have the tracker itself. loop over all its components to store them.
50  putOne(tracker, pgd, 0);
51  std::vector<const GeometricDet*> tc = tracker->components();
52  std::vector<const GeometricDet*>::const_iterator git = tc.begin();
53  std::vector<const GeometricDet*>::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 GeometricDet*> inone = (*git)->components();
59  if ( inone.size() == 0 ) ++count;
60  std::vector<const GeometricDet*>::const_iterator git2 = inone.begin();
61  std::vector<const GeometricDet*>::const_iterator egit2 = inone.end();
62  ++lev;
63  for (; git2 != egit2; ++git2) { // level 2
64  putOne(*git2, pgd, lev);
65  std::vector<const GeometricDet*> intwo= (*git2)->components();
66  if ( intwo.size() == 0 ) ++count;
67  std::vector<const GeometricDet*>::const_iterator git3 = intwo.begin();
68  std::vector<const GeometricDet*>::const_iterator egit3 = intwo.end();
69  ++lev;
70  for (; git3 != egit3; ++git3) { // level 3
71  putOne(*git3, pgd, lev);
72  std::vector<const GeometricDet*> inthree= (*git3)->components();
73  if ( inthree.size() == 0 ) ++count;
74  std::vector<const GeometricDet*>::const_iterator git4 = inthree.begin();
75  std::vector<const GeometricDet*>::const_iterator egit4 = inthree.end();
76  ++lev;
77  for (; git4 != egit4; ++git4) { //level 4
78  putOne(*git4, pgd, lev);
79  std::vector<const GeometricDet*> infour= (*git4)->components();
80  if ( infour.size() == 0 ) ++count;
81  std::vector<const GeometricDet*>::const_iterator git5 = infour.begin();
82  std::vector<const GeometricDet*>::const_iterator egit5 = infour.end();
83  ++lev;
84  for (; git5 != egit5; ++git5) { // level 5
85  putOne(*git5, pgd, lev);
86  std::vector<const GeometricDet*> infive= (*git5)->components();
87  if ( infive.size() == 0 ) ++count;
88  std::vector<const GeometricDet*>::const_iterator git6 = infive.begin();
89  std::vector<const GeometricDet*>::const_iterator egit6 = infive.end();
90  ++lev;
91  for (; git6 != egit6; ++git6) { //level 6
92  putOne(*git6, pgd, lev);
93  std::vector<const GeometricDet*> insix= (*git6)->components();
94  if ( insix.size() == 0 ) ++count;
95  } // level 6
96  --lev;
97  } // level 5
98  --lev;
99  } // level 4
100  --lev;
101  } //level 3
102  --lev;
103  } // level 2
104  --lev;
105  }
106  std::vector<const GeometricDet*> modules = tracker->deepComponents();
107  if ( mydbservice->isNewTagRequest("IdealGeometryRecord") ) {
108  mydbservice->createNewIOV<PGeometricDet>( pgd,mydbservice->beginOfTime(),mydbservice->endOfTime(),"IdealGeometryRecord");
109  } else {
110  edm::LogError("PGeometricDetBuilder")<<"PGeometricDetBuilder Tag already present";
111  }
112 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:169
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void putOne(const GeometricDet *gd, PGeometricDet *pgd, int lev)
ConstGeometricDetContainer deepComponents() const
virtual void PGeometricDetBuilder::endJob ( void  )
inlinevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file PGeometricDetBuilder.h.

21 {};
void PGeometricDetBuilder::putOne ( const GeometricDet gd,
PGeometricDet pgd,
int  lev 
)

Definition at line 114 of file PGeometricDetBuilder.cc.

References PGeometricDet::Item::_a11, PGeometricDet::Item::_a12, PGeometricDet::Item::_a13, PGeometricDet::Item::_a21, PGeometricDet::Item::_a22, PGeometricDet::Item::_a23, PGeometricDet::Item::_a31, PGeometricDet::Item::_a32, PGeometricDet::Item::_a33, PGeometricDet::Item::_geographicalID, PGeometricDet::Item::_level, PGeometricDet::Item::_name, PGeometricDet::Item::_ns, PGeometricDet::Item::_nt0, PGeometricDet::Item::_nt1, PGeometricDet::Item::_nt10, PGeometricDet::Item::_nt2, PGeometricDet::Item::_nt3, PGeometricDet::Item::_nt4, PGeometricDet::Item::_nt5, PGeometricDet::Item::_nt6, PGeometricDet::Item::_nt7, PGeometricDet::Item::_nt8, PGeometricDet::Item::_nt9, PGeometricDet::Item::_numnt, PGeometricDet::Item::_params0, PGeometricDet::Item::_params1, PGeometricDet::Item::_params10, PGeometricDet::Item::_params2, PGeometricDet::Item::_params3, PGeometricDet::Item::_params4, PGeometricDet::Item::_params5, PGeometricDet::Item::_params6, PGeometricDet::Item::_params7, PGeometricDet::Item::_params8, PGeometricDet::Item::_params9, PGeometricDet::Item::_phi, PGeometricDet::Item::_pixROCCols, PGeometricDet::Item::_pixROCRows, PGeometricDet::Item::_pixROCx, PGeometricDet::Item::_pixROCy, PGeometricDet::Item::_radLength, PGeometricDet::Item::_rho, PGeometricDet::Item::_shape, PGeometricDet::Item::_siliconAPVNum, PGeometricDet::Item::_stereo, PGeometricDet::Item::_type, PGeometricDet::Item::_x, PGeometricDet::Item::_xi, PGeometricDet::Item::_y, PGeometricDet::Item::_z, GeometricDet::geographicalID(), DDName::name(), GeometricDet::name(), GeometricDet::navType(), DDName::ns(), nt, GeometricDet::params(), PGeometricDet::pgeomdets_, GeometricDet::phi(), GeometricDet::pixROCCols(), GeometricDet::pixROCRows(), GeometricDet::pixROCx(), GeometricDet::pixROCy(), GeometricDet::radLength(), GeometricDet::rho(), makeMuonMisalignmentScenario::rot, GeometricDet::rotation(), GeometricDet::shape(), GeometricDet::siliconAPVNum(), GeometricDet::stereo(), GeometricDet::translation(), GeometricDet::type(), x, GeometricDet::xi(), detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by beginRun().

114  {
115 
116  PGeometricDet::Item item;
117  DDTranslation tran = gd->translation();
118  DDRotationMatrix rot = gd->rotation();
119  DD3Vector x, y, z;
120  rot.GetComponents(x, y, z);
121  item._name = gd->name().name();
122  item._ns = gd->name().ns();
123  item._level = lev;
124  item._x = tran.X();
125  item._y = tran.Y();
126  item._z = tran.Z();
127  item._phi = gd->phi();
128  item._rho = gd->rho();
129  item._a11 = x.X();
130  item._a12 = y.X();
131  item._a13 = z.X();
132  item._a21 = x.Y();
133  item._a22 = y.Y();
134  item._a23 = z.Y();
135  item._a31 = x.Z();
136  item._a32 = y.Z();
137  item._a33 = z.Z();
138  item._shape = gd->shape();
139  item._type = gd->type();
140  if(gd->shape()==1){
141  item._params0=gd->params()[0];
142  item._params1=gd->params()[1];
143  item._params2=gd->params()[2];
144  item._params3=0;
145  item._params4=0;
146  item._params5=0;
147  item._params6=0;
148  item._params7=0;
149  item._params8=0;
150  item._params9=0;
151  item._params10=0;
152  }else if(gd->shape()==3){
153  item._params0=gd->params()[0];
154  item._params1=gd->params()[1];
155  item._params2=gd->params()[2];
156  item._params3=gd->params()[3];
157  item._params4=gd->params()[4];
158  item._params5=gd->params()[5];
159  item._params6=gd->params()[6];
160  item._params7=gd->params()[7];
161  item._params8=gd->params()[8];
162  item._params9=gd->params()[9];
163  item._params10=gd->params()[10];
164  }else{
165  item._params0=0;
166  item._params1=0;
167  item._params2=0;
168  item._params3=0;
169  item._params4=0;
170  item._params5=0;
171  item._params6=0;
172  item._params7=0;
173  item._params8=0;
174  item._params9=0;
175  item._params10=0;
176  }
177  item._geographicalID = gd->geographicalID();
178  item._radLength = gd->radLength();
179  item._xi = gd->xi();
180  item._pixROCRows = gd->pixROCRows();
181  item._pixROCCols = gd->pixROCCols();
182  item._pixROCx = gd->pixROCx();
183  item._pixROCy = gd->pixROCy();
184  item._stereo = gd->stereo();
185  item._siliconAPVNum = gd->siliconAPVNum();
186 
187  GeometricDet::nav_type const & nt = gd->navType();
188  size_t nts = nt.size();
189  item._numnt = nts;
190  std::vector<int> tempnt(nt.begin(),nt.end());
191  for ( size_t extrant = nt.size(); extrant < 11; ++extrant ) {
192  tempnt.push_back(-1);
193  }
194  item._nt0 = tempnt[0];
195  item._nt1 = tempnt[1];
196  item._nt2 = tempnt[2];
197  item._nt3 = tempnt[3];
198  item._nt4 = tempnt[4];
199  item._nt5 = tempnt[5];
200  item._nt6 = tempnt[6];
201  item._nt7 = tempnt[7];
202  item._nt8 = tempnt[8];
203  item._nt9 = tempnt[9];
204  item._nt10 = tempnt[10];
205 
206  pgd->pgeomdets_.push_back ( item );
207 }
double pixROCy() const
Definition: GeometricDet.h:269
double radLength() const
Definition: GeometricDet.h:246
nav_type const & navType() const
Definition: GeometricDet.h:144
DDSolidShape const & shape() const
Definition: GeometricDet.h:131
std::vector< Item > pgeomdets_
Definition: PGeometricDet.h:50
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:101
DetId geographicalID() const
Definition: GeometricDet.h:201
float float float z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< double > const & params() const
Definition: GeometricDet.h:158
DDName const & name() const
Definition: GeometricDet.h:139
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
DDTranslation const & translation() const
Definition: GeometricDet.h:118
double pixROCCols() const
Definition: GeometricDet.h:261
DDRotationMatrix const & rotation() const
Definition: GeometricDet.h:114
int nt
Definition: AMPTWrapper.h:32
double xi() const
Definition: GeometricDet.h:250
double pixROCx() const
Definition: GeometricDet.h:265
double phi() const
Definition: GeometricDet.h:122
double siliconAPVNum() const
Definition: GeometricDet.h:281
DDExpandedView::nav_type nav_type
Definition: GeometricDet.h:44
Definition: DDAxes.h:10
bool stereo() const
Definition: GeometricDet.h:277
double pixROCRows() const
Definition: GeometricDet.h:257
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
GeometricEnumType type() const
Definition: GeometricDet.h:135
double rho() const
Definition: GeometricDet.h:126