CMS 3D CMS Logo

FakeCaloAlignmentEP.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FakeCaloAlignmentEP
4 // Class: FakeCaloAlignmentEP
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 std::shared_ptr<Alignments> ReturnAli ;
65  typedef std::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 
113  ReturnAliErr produceEBAliErr( const EBAlignmentErrorExtendedRcd& /*iRecord*/ )
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( Trl( 0, 0, 0 ),
130  Rot(),
131  id ) ) ;
132  }
133  return ali ;
134  }
135 
136  ReturnAliErr produceEEAliErr( const EEAlignmentErrorExtendedRcd& /*iRecord*/ )
137  {
138  ReturnAliErr aliErr ( new AlignmentErrors );
139  return aliErr ;
140  }
141 //-------------------------------------------------------------------
142 
143  ReturnAli produceESAli( const ESAlignmentRcd& /*iRecord*/ )
144  {
145  ReturnAli ali ( new Alignments ) ;
146  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
147  const unsigned int nA ( EcalPreshowerGeometry::numberOfAlignments() ) ;
148  vtr.reserve( nA ) ;
149  for( unsigned int i ( 0 ) ; i != nA ; ++i )
150  {
152  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
153  Rot(),
154  id ) ) ;
155  }
156  return ali ;
157  }
158 
159  ReturnAliErr produceESAliErr( const ESAlignmentErrorExtendedRcd& /*iRecord*/ )
160  {
161  ReturnAliErr aliErr ( new AlignmentErrors );
162  return aliErr ;
163  }
164 //-------------------------------------------------------------------
165 
166  ReturnAli produceHBAli( const HBAlignmentRcd& /*iRecord*/ )
167  {
168  ReturnAli ali ( new Alignments ) ;
169  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
170  const unsigned int nA ( HcalGeometry::numberOfBarrelAlignments() ) ;
171  vtr.reserve( nA ) ;
172  for( unsigned int i ( 0 ) ; i != nA ; ++i )
173  {
175  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
176  Rot(),
177  id ) ) ;
178  }
179  return ali ;
180  }
181 
182  ReturnAliErr produceHBAliErr( const HBAlignmentErrorExtendedRcd& /*iRecord*/ )
183  {
184  ReturnAliErr aliErr ( new AlignmentErrors );
185  return aliErr ;
186  }
187 //-------------------------------------------------------------------
188 
189  ReturnAli produceHEAli( const HEAlignmentRcd& /*iRecord*/ )
190  {
191  ReturnAli ali ( new Alignments ) ;
192  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
193  const unsigned int nA ( HcalGeometry::numberOfEndcapAlignments() ) ;
194  vtr.reserve( nA ) ;
195  for( unsigned int i ( 0 ) ; i != nA ; ++i )
196  {
198  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
199  Rot(),
200  id ) ) ;
201  }
202  return ali ;
203  }
204 
205  ReturnAliErr produceHEAliErr( const HEAlignmentErrorExtendedRcd& /*iRecord*/ )
206  {
207  ReturnAliErr aliErr ( new AlignmentErrors );
208  return aliErr ;
209  }
210 //-------------------------------------------------------------------
211 
212  ReturnAli produceHOAli( const HOAlignmentRcd& /*iRecord*/ )
213  {
214  ReturnAli ali ( new Alignments ) ;
215  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
216  const unsigned int nA ( HcalGeometry::numberOfOuterAlignments() ) ;
217  vtr.reserve( nA ) ;
218  for( unsigned int i ( 0 ) ; i != nA ; ++i )
219  {
221  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
222  Rot(),
223  id ) ) ;
224  }
225  return ali ;
226  }
227 
228  ReturnAliErr produceHOAliErr( const HOAlignmentErrorExtendedRcd& /*iRecord*/ )
229  {
230  ReturnAliErr aliErr ( new AlignmentErrors );
231  return aliErr ;
232  }
233 //-------------------------------------------------------------------
234 
235  ReturnAli produceHFAli( const HFAlignmentRcd& /*iRecord*/ )
236  {
237  ReturnAli ali ( new Alignments ) ;
238  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
239  const unsigned int nA ( HcalGeometry::numberOfForwardAlignments() ) ;
240  vtr.reserve( nA ) ;
241  for( unsigned int i ( 0 ) ; i != nA ; ++i )
242  {
244  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
245  Rot(),
246  id ) ) ;
247  }
248  return ali ;
249  }
250 
251  ReturnAliErr produceHFAliErr( const HFAlignmentErrorExtendedRcd& /*iRecord*/ )
252  {
253  ReturnAliErr aliErr ( new AlignmentErrors );
254  return aliErr ;
255  }
256 //-------------------------------------------------------------------
257 
258  ReturnAli produceZdcAli( const ZDCAlignmentRcd& /*iRecord*/ )
259  {
260  ReturnAli ali ( new Alignments ) ;
261  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
262  const unsigned int nA ( ZdcGeometry::numberOfAlignments() ) ;
263  vtr.reserve( nA ) ;
264  for( unsigned int i ( 0 ) ; i != nA ; ++i )
265  {
266  const HcalZDCDetId id ( HcalZDCDetId::EM, false, 1 ) ;
267  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
268  Rot(),
269  id ) ) ;
270  }
271  return ali ;
272  }
273 
274  ReturnAliErr produceZdcAliErr( const ZDCAlignmentErrorExtendedRcd& /*iRecord*/ )
275  {
276  ReturnAliErr aliErr ( new AlignmentErrors );
277  return aliErr ;
278  }
279 //-------------------------------------------------------------------
280 
281  ReturnAli produceCastorAli( const CastorAlignmentRcd& /*iRecord*/ )
282  {
283  ReturnAli ali ( new Alignments ) ;
284  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
285  const unsigned int nA ( CastorGeometry::numberOfAlignments() ) ;
286  vtr.reserve( nA ) ;
287  for( unsigned int i ( 0 ) ; i != nA ; ++i )
288  {
289  const HcalCastorDetId id ( HcalCastorDetId::EM, false, 1, 1 ) ;
290  vtr.push_back( AlignTransform( Trl( 0, 0, 0 ),
291  Rot(),
292  id ) ) ;
293  }
294  return ali ;
295  }
296 
297  ReturnAliErr produceCastorAliErr( const CastorAlignmentErrorExtendedRcd& /*iRecord*/ )
298  {
299  ReturnAliErr aliErr ( new AlignmentErrors );
300  return aliErr ;
301  }
302 };
303 
304 
305 //define this as a plug-in
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:65
ReturnAli produceEEAli(const EEAlignmentRcd &)
ReturnAli produceHFAli(const HFAlignmentRcd &)
ReturnAli produceCastorAli(const CastorAlignmentRcd &)
static unsigned int numberOfAlignments()
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
ReturnAliErr produceHEAliErr(const HEAlignmentErrorExtendedRcd &)
std::shared_ptr< AlignmentErrors > ReturnAliErr
CLHEP::Hep3Vector Translation
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 produceHBAliErr(const HBAlignmentErrorExtendedRcd &)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
ReturnAliErr produceHOAliErr(const HOAlignmentErrorExtendedRcd &)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:71
ReturnAli produceHBAli(const HBAlignmentRcd &)
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
ReturnAli produceEBAli(const EBAlignmentRcd &)
static unsigned int numberOfAlignments()
std::shared_ptr< Alignments > ReturnAli
ReturnAliErr produceEEAliErr(const EEAlignmentErrorExtendedRcd &)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:67
AlignTransform::Translation Trl
ReturnAli produceZdcAli(const ZDCAlignmentRcd &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnAliErr produceZdcAliErr(const ZDCAlignmentErrorExtendedRcd &)
ReturnAli produceHEAli(const HEAlignmentRcd &)
FakeCaloAlignmentEP(const edm::ParameterSet &)
ReturnAliErr produceHFAliErr(const HFAlignmentErrorExtendedRcd &)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:69
ReturnAliErr produceCastorAliErr(const CastorAlignmentErrorExtendedRcd &)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
ReturnAliErr produceESAliErr(const ESAlignmentErrorExtendedRcd &)
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
ReturnAli produceESAli(const ESAlignmentRcd &)
ReturnAli produceHOAli(const HOAlignmentRcd &)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
AlignTransform::Rotation Rot
ReturnAliErr produceEBAliErr(const EBAlignmentErrorExtendedRcd &)
CLHEP::HepRotation Rotation