CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  typedef boost::shared_ptr<Alignments> ReturnAli ;
65  typedef boost::shared_ptr<AlignmentErrors> ReturnAliErr ;
66 
69 
71  {
90  }
91 
93 
94 //-------------------------------------------------------------------
95 
96  ReturnAli produceEBAli( const EBAlignmentRcd& /*iRecord*/ )
97  {
98  ReturnAli ali ( new 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.push_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  ReturnAliErr aliErr ( new AlignmentErrors );
116  return aliErr ;
117  }
118 //-------------------------------------------------------------------
119 
120  ReturnAli produceEEAli( const EEAlignmentRcd& /*iRecord*/ )
121  {
122  ReturnAli ali ( new Alignments ) ;
123  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
124  const unsigned int nA ( EcalEndcapGeometry::numberOfAlignments() ) ;
125  vtr.reserve( nA ) ;
126  for( unsigned int i ( 0 ) ; i != nA ; ++i )
127  {
129  vtr.push_back( AlignTransform( ( 2 > i ? Trl( -0.02, -0.81, -0.94 ) :
130  Trl( +0.52, -0.81, +0.81 ) ) ,
131  Rot(),
132  id ) ) ;
133  }
134  return ali ;
135  }
136 
138  {
139  ReturnAliErr aliErr ( new AlignmentErrors );
140  return aliErr ;
141  }
142 //-------------------------------------------------------------------
143 
144  ReturnAli produceESAli( const ESAlignmentRcd& /*iRecord*/ )
145  {
146  ReturnAli ali ( new Alignments ) ;
147  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
148  const unsigned int nA ( EcalPreshowerGeometry::numberOfAlignments() ) ;
149  vtr.reserve( nA ) ;
150  for( unsigned int i ( 0 ) ; i != nA ; ++i )
151  {
153  vtr.push_back( AlignTransform( ( 4 > i ? Trl( -0.02, -0.81, -0.94 ) :
154  Trl( +0.52, -0.81, +0.81 ) ) ,
155  Rot(),
156  id ) ) ;
157  }
158  return ali ;
159  }
160 
162  {
163  ReturnAliErr aliErr ( new AlignmentErrors );
164  return aliErr ;
165  }
166 //-------------------------------------------------------------------
167 
168  ReturnAli produceHBAli( const HBAlignmentRcd& /*iRecord*/ )
169  {
170  ReturnAli ali ( new Alignments ) ;
171  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
172  const unsigned int nA ( HcalGeometry::numberOfBarrelAlignments() ) ;
173  vtr.reserve( nA ) ;
174  for( unsigned int i ( 0 ) ; i != nA ; ++i )
175  {
177  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
178  Rot(),
179  id ) ) ;
180  }
181  return ali ;
182  }
183 
185  {
186  ReturnAliErr aliErr ( new AlignmentErrors );
187  return aliErr ;
188  }
189 //-------------------------------------------------------------------
190 
191  ReturnAli produceHEAli( const HEAlignmentRcd& /*iRecord*/ )
192  {
193  ReturnAli ali ( new Alignments ) ;
194  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
195  const unsigned int nA ( HcalGeometry::numberOfEndcapAlignments() ) ;
196  vtr.reserve( nA ) ;
197  for( unsigned int i ( 0 ) ; i != nA ; ++i )
198  {
200  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
201  Rot(),
202  id ) ) ;
203  }
204  return ali ;
205  }
206 
208  {
209  ReturnAliErr aliErr ( new AlignmentErrors );
210  return aliErr ;
211  }
212 //-------------------------------------------------------------------
213 
214  ReturnAli produceHOAli( const HOAlignmentRcd& /*iRecord*/ )
215  {
216  ReturnAli ali ( new Alignments ) ;
217  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
218  const unsigned int nA ( HcalGeometry::numberOfOuterAlignments() ) ;
219  vtr.reserve( nA ) ;
220  for( unsigned int i ( 0 ) ; i != nA ; ++i )
221  {
223  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
224  Rot(),
225  id ) ) ;
226  }
227  return ali ;
228  }
229 
231  {
232  ReturnAliErr aliErr ( new AlignmentErrors );
233  return aliErr ;
234  }
235 //-------------------------------------------------------------------
236 
237  ReturnAli produceHFAli( const HFAlignmentRcd& /*iRecord*/ )
238  {
239  ReturnAli ali ( new Alignments ) ;
240  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
241  const unsigned int nA ( HcalGeometry::numberOfForwardAlignments() ) ;
242  vtr.reserve( nA ) ;
243  for( unsigned int i ( 0 ) ; i != nA ; ++i )
244  {
246  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
247  Rot(),
248  id ) ) ;
249  }
250  return ali ;
251  }
252 
254  {
255  ReturnAliErr aliErr ( new AlignmentErrors );
256  return aliErr ;
257  }
258 //-------------------------------------------------------------------
259 
260  ReturnAli produceZdcAli( const ZDCAlignmentRcd& /*iRecord*/ )
261  {
262  ReturnAli ali ( new Alignments ) ;
263  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
264  const unsigned int nA ( ZdcGeometry::numberOfAlignments() ) ;
265  vtr.reserve( nA ) ;
266  for( unsigned int i ( 0 ) ; i != nA ; ++i )
267  {
268  const HcalZDCDetId id ( HcalZDCDetId::EM, false, 1 ) ;
269  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
270  Rot(),
271  id ) ) ;
272  }
273  return ali ;
274  }
275 
277  {
278  ReturnAliErr aliErr ( new AlignmentErrors );
279  return aliErr ;
280  }
281 //-------------------------------------------------------------------
282 
284  {
285  ReturnAli ali ( new Alignments ) ;
286  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
287  const unsigned int nA ( CastorGeometry::numberOfAlignments() ) ;
288  vtr.reserve( nA ) ;
289  for( unsigned int i ( 0 ) ; i != nA ; ++i )
290  {
291  const HcalCastorDetId id ( HcalCastorDetId::EM, false, 1, 1 ) ;
292  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
293  Rot(),
294  id ) ) ;
295  }
296  return ali ;
297  }
298 
300  {
301  ReturnAliErr aliErr ( new AlignmentErrors );
302  return aliErr ;
303  }
304 };
305 
306 
307 //define this as a plug-in
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:56
ReturnAli produceHFAli(const HFAlignmentRcd &)
ReturnAliErr produceZdcAliErr(const ZDCAlignmentErrorExtendedRcd &)
ReturnAli produceHEAli(const HEAlignmentRcd &)
int i
Definition: DBlmapReader.cc:9
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
static unsigned int numberOfAlignments()
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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:62
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
boost::shared_ptr< Alignments > ReturnAli
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
ReturnAliErr produceHOAliErr(const HOAlignmentErrorExtendedRcd &)
static unsigned int numberOfAlignments()
ReturnAli produceHOAli(const HOAlignmentRcd &)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:58
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnAliErr produceHBAliErr(const HBAlignmentErrorExtendedRcd &)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
AlignTransform::Rotation Rot
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
ReturnAli produceHBAli(const HBAlignmentRcd &)
boost::shared_ptr< AlignmentErrors > ReturnAliErr
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