CMS 3D CMS Logo

TestCaloAlignmentEP.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TestCaloAlignmentEP
4 // Class: TestCaloAlignmentEP
5 //
13 //
14 // Original Author: Brian Heltsley
15 //
16 //
17 
18 
19 // System
20 #include <memory>
21 
22 // Framework
26 
27 
28 
29 // Alignment
59 
61 {
62  public:
63 
64  using ReturnAli = std::unique_ptr<Alignments>;
65  using ReturnAliErr = std::unique_ptr<AlignmentErrors>;
66 
69 
71  {
90  }
91 
92  ~TestCaloAlignmentEP() override {}
93 
94 //-------------------------------------------------------------------
95 
96  ReturnAli produceEBAli( const EBAlignmentRcd& /*iRecord*/ )
97  {
98  ReturnAli ali = std::make_unique<Alignments>();
99  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
100  const unsigned int nA ( EcalBarrelGeometry::numberOfAlignments() ) ;
101  vtr.reserve( nA ) ;
102  for( unsigned int i ( 0 ) ; i != nA ; ++i )
103  {
105  vtr.emplace_back( AlignTransform( ( 1==id.ism() ? Trl( 0, 0, 0 ) : //-0.3 ) :
106  Trl(0,0,0 ) ) ,
107  Rot(),
108  id ) ) ;
109  }
110  return ali ;
111  }
112 
114  {
115  return std::make_unique<AlignmentErrors>();
116  }
117 //-------------------------------------------------------------------
118 
119  ReturnAli produceEEAli( const EEAlignmentRcd& /*iRecord*/ )
120  {
121  ReturnAli ali = std::make_unique<Alignments>();
122  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
123  const unsigned int nA ( EcalEndcapGeometry::numberOfAlignments() ) ;
124  vtr.reserve( nA ) ;
125  for( unsigned int i ( 0 ) ; i != nA ; ++i )
126  {
128  vtr.emplace_back( AlignTransform( ( 2 > i ? Trl( -0.02, -0.81, -0.94 ) :
129  Trl( +0.52, -0.81, +0.81 ) ) ,
130  Rot(),
131  id ) ) ;
132  }
133  return ali ;
134  }
135 
137  {
138  return std::make_unique<AlignmentErrors>();
139  }
140 //-------------------------------------------------------------------
141 
142  ReturnAli produceESAli( const ESAlignmentRcd& /*iRecord*/ )
143  {
144  ReturnAli ali = std::make_unique<Alignments>();
145  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
146  const unsigned int nA ( EcalPreshowerGeometry::numberOfAlignments() ) ;
147  vtr.reserve( nA ) ;
148  for( unsigned int i ( 0 ) ; i != nA ; ++i )
149  {
151  vtr.emplace_back( AlignTransform( ( 4 > i ? Trl( -0.02, -0.81, -0.94 ) :
152  Trl( +0.52, -0.81, +0.81 ) ) ,
153  Rot(),
154  id ) ) ;
155  }
156  return ali ;
157  }
158 
160  {
161  return std::make_unique<AlignmentErrors>();
162  }
163 //-------------------------------------------------------------------
164 
165  ReturnAli produceHBAli( const HBAlignmentRcd& /*iRecord*/ )
166  {
167  ReturnAli ali = std::make_unique<Alignments>();
168  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
169  const unsigned int nA ( HcalGeometry::numberOfBarrelAlignments() ) ;
170  vtr.reserve( nA ) ;
171  for( unsigned int i ( 0 ) ; i != nA ; ++i )
172  {
174  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
175  Rot(),
176  id ) ) ;
177  }
178  return ali ;
179  }
180 
182  {
183  return std::make_unique<AlignmentErrors>();
184  }
185 //-------------------------------------------------------------------
186 
187  ReturnAli produceHEAli( const HEAlignmentRcd& /*iRecord*/ )
188  {
189  ReturnAli ali = std::make_unique<Alignments>();
190  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
191  const unsigned int nA ( HcalGeometry::numberOfEndcapAlignments() ) ;
192  vtr.reserve( nA ) ;
193  for( unsigned int i ( 0 ) ; i != nA ; ++i )
194  {
196  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
197  Rot(),
198  id ) ) ;
199  }
200  return ali ;
201  }
202 
204  {
205  return std::make_unique<AlignmentErrors>();
206  }
207 //-------------------------------------------------------------------
208 
209  ReturnAli produceHOAli( const HOAlignmentRcd& /*iRecord*/ )
210  {
211  ReturnAli ali = std::make_unique<Alignments>();
212  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
213  const unsigned int nA ( HcalGeometry::numberOfOuterAlignments() ) ;
214  vtr.reserve( nA ) ;
215  for( unsigned int i ( 0 ) ; i != nA ; ++i )
216  {
218  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
219  Rot(),
220  id ) ) ;
221  }
222  return ali ;
223  }
224 
226  {
227  return std::make_unique<AlignmentErrors>();
228  }
229 //-------------------------------------------------------------------
230 
231  ReturnAli produceHFAli( const HFAlignmentRcd& /*iRecord*/ )
232  {
233  ReturnAli ali = std::make_unique<Alignments>();
234  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
235  const unsigned int nA ( HcalGeometry::numberOfForwardAlignments() ) ;
236  vtr.reserve( nA ) ;
237  for( unsigned int i ( 0 ) ; i != nA ; ++i )
238  {
240  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
241  Rot(),
242  id ) ) ;
243  }
244  return ali ;
245  }
246 
248  {
249  return std::make_unique<AlignmentErrors>();
250  }
251 //-------------------------------------------------------------------
252 
253  ReturnAli produceZdcAli( const ZDCAlignmentRcd& /*iRecord*/ )
254  {
255  ReturnAli ali = std::make_unique<Alignments>();
256  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
257  const unsigned int nA ( ZdcGeometry::numberOfAlignments() ) ;
258  vtr.reserve( nA ) ;
259  for( unsigned int i ( 0 ) ; i != nA ; ++i )
260  {
261  const HcalZDCDetId id ( HcalZDCDetId::EM, false, 1 ) ;
262  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
263  Rot(),
264  id ) ) ;
265  }
266  return ali ;
267  }
268 
270  {
271  return std::make_unique<AlignmentErrors>();
272  }
273 //-------------------------------------------------------------------
274 
276  {
277  ReturnAli ali = std::make_unique<Alignments>();
278  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
279  const unsigned int nA ( CastorGeometry::numberOfAlignments() ) ;
280  vtr.reserve( nA ) ;
281  for( unsigned int i ( 0 ) ; i != nA ; ++i )
282  {
283  const HcalCastorDetId id ( HcalCastorDetId::EM, false, 1, 1 ) ;
284  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
285  Rot(),
286  id ) ) ;
287  }
288  return ali ;
289  }
290 
292  {
293  return std::make_unique<AlignmentErrors>();
294  }
295 };
296 
297 
298 //define this as a plug-in
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:69
ReturnAli produceHFAli(const HFAlignmentRcd &)
ReturnAliErr produceZdcAliErr(const ZDCAlignmentErrorExtendedRcd &)
ReturnAli produceHEAli(const HEAlignmentRcd &)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
ReturnAli produceESAli(const ESAlignmentRcd &)
ReturnAliErr produceEEAliErr(const EEAlignmentErrorExtendedRcd &)
static unsigned int numberOfAlignments()
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
CLHEP::Hep3Vector Translation
ReturnAliErr produceHEAliErr(const HEAlignmentErrorExtendedRcd &)
ReturnAliErr produceHFAliErr(const HFAlignmentErrorExtendedRcd &)
ReturnAli produceCastorAli(const CastorAlignmentRcd &)
static unsigned int numberOfAlignments()
Definition: ZdcGeometry.h:48
std::unique_ptr< AlignmentErrors > ReturnAliErr
static unsigned int numberOfAlignments()
static unsigned int numberOfAlignments()
ReturnAliErr produceESAliErr(const ESAlignmentErrorExtendedRcd &)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:75
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
ReturnAliErr produceHOAliErr(const HOAlignmentErrorExtendedRcd &)
static unsigned int numberOfAlignments()
std::unique_ptr< Alignments > ReturnAli
ReturnAli produceHOAli(const HOAlignmentRcd &)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:71
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnAliErr produceHBAliErr(const HBAlignmentErrorExtendedRcd &)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:73
AlignTransform::Rotation Rot
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
ReturnAli produceHBAli(const HBAlignmentRcd &)
ReturnAliErr produceCastorAliErr(const CastorAlignmentErrorExtendedRcd &)
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
ReturnAli produceEBAli(const EBAlignmentRcd &)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
ReturnAli produceEEAli(const EEAlignmentRcd &)
ReturnAliErr produceEBAliErr(const EBAlignmentErrorExtendedRcd &)
ReturnAli produceZdcAli(const ZDCAlignmentRcd &)
TestCaloAlignmentEP(const edm::ParameterSet &)
AlignTransform::Translation Trl
CLHEP::HepRotation Rotation