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  using ReturnAli = std::unique_ptr<Alignments>;
65  using ReturnAliErr = std::unique_ptr<AlignmentErrors>;
66 
69 
71  {
90  }
91 
92  ~FakeCaloAlignmentEP() 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( Trl( 0, 0, 0 ),
129  Rot(),
130  id ) ) ;
131  }
132  return ali ;
133  }
134 
136  {
137  return std::make_unique<AlignmentErrors>();
138  }
139 //-------------------------------------------------------------------
140 
141  ReturnAli produceESAli( const ESAlignmentRcd& /*iRecord*/ )
142  {
143  ReturnAli ali = std::make_unique<Alignments>();
144  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
145  const unsigned int nA ( EcalPreshowerGeometry::numberOfAlignments() ) ;
146  vtr.reserve( nA ) ;
147  for( unsigned int i ( 0 ) ; i != nA ; ++i )
148  {
150  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
151  Rot(),
152  id ) ) ;
153  }
154  return ali ;
155  }
156 
158  {
159  return std::make_unique<AlignmentErrors>();
160  }
161 //-------------------------------------------------------------------
162 
163  ReturnAli produceHBAli( const HBAlignmentRcd& /*iRecord*/ )
164  {
165  ReturnAli ali = std::make_unique<Alignments>();
166  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
167  const unsigned int nA ( HcalGeometry::numberOfBarrelAlignments() ) ;
168  vtr.reserve( nA ) ;
169  for( unsigned int i ( 0 ) ; i != nA ; ++i )
170  {
172  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
173  Rot(),
174  id ) ) ;
175  }
176  return ali ;
177  }
178 
180  {
181  return std::make_unique<AlignmentErrors>();
182  }
183 //-------------------------------------------------------------------
184 
185  ReturnAli produceHEAli( const HEAlignmentRcd& /*iRecord*/ )
186  {
187  ReturnAli ali = std::make_unique<Alignments>();
188  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
189  const unsigned int nA ( HcalGeometry::numberOfEndcapAlignments() ) ;
190  vtr.reserve( nA ) ;
191  for( unsigned int i ( 0 ) ; i != nA ; ++i )
192  {
194  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
195  Rot(),
196  id ) ) ;
197  }
198  return ali ;
199  }
200 
202  {
203  return std::make_unique<AlignmentErrors>();
204  }
205 //-------------------------------------------------------------------
206 
207  ReturnAli produceHOAli( const HOAlignmentRcd& /*iRecord*/ )
208  {
209  ReturnAli ali = std::make_unique<Alignments>();
210  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
211  const unsigned int nA ( HcalGeometry::numberOfOuterAlignments() ) ;
212  vtr.reserve( nA ) ;
213  for( unsigned int i ( 0 ) ; i != nA ; ++i )
214  {
216  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
217  Rot(),
218  id ) ) ;
219  }
220  return ali ;
221  }
222 
224  {
225  return std::make_unique<AlignmentErrors>();
226  }
227 //-------------------------------------------------------------------
228 
229  ReturnAli produceHFAli( const HFAlignmentRcd& /*iRecord*/ )
230  {
231  ReturnAli ali = std::make_unique<Alignments>();
232  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
233  const unsigned int nA ( HcalGeometry::numberOfForwardAlignments() ) ;
234  vtr.reserve( nA ) ;
235  for( unsigned int i ( 0 ) ; i != nA ; ++i )
236  {
238  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
239  Rot(),
240  id ) ) ;
241  }
242  return ali ;
243  }
244 
246  {
247  return std::make_unique<AlignmentErrors>();
248  }
249 //-------------------------------------------------------------------
250 
251  ReturnAli produceZdcAli( const ZDCAlignmentRcd& /*iRecord*/ )
252  {
253  ReturnAli ali = std::make_unique<Alignments>();
254  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
255  const unsigned int nA ( ZdcGeometry::numberOfAlignments() ) ;
256  vtr.reserve( nA ) ;
257  for( unsigned int i ( 0 ) ; i != nA ; ++i )
258  {
259  const HcalZDCDetId id ( HcalZDCDetId::EM, false, 1 ) ;
260  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
261  Rot(),
262  id ) ) ;
263  }
264  return ali ;
265  }
266 
268  {
269  return std::make_unique<AlignmentErrors>();
270  }
271 //-------------------------------------------------------------------
272 
274  {
275  ReturnAli ali = std::make_unique<Alignments>();
276  std::vector<AlignTransform>& vtr ( ali->m_align ) ;
277  const unsigned int nA ( CastorGeometry::numberOfAlignments() ) ;
278  vtr.reserve( nA ) ;
279  for( unsigned int i ( 0 ) ; i != nA ; ++i )
280  {
281  const HcalCastorDetId id ( HcalCastorDetId::EM, false, 1, 1 ) ;
282  vtr.emplace_back( AlignTransform( Trl( 0, 0, 0 ),
283  Rot(),
284  id ) ) ;
285  }
286  return ali ;
287  }
288 
290  {
291  return std::make_unique<AlignmentErrors>();
292  }
293 };
294 
295 
296 //define this as a plug-in
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:69
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
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 &)
CLHEP::Hep3Vector Translation
static unsigned int numberOfAlignments()
Definition: ZdcGeometry.h:48
static unsigned int numberOfAlignments()
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:75
ReturnAli produceHBAli(const HBAlignmentRcd &)
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
std::unique_ptr< Alignments > ReturnAli
ReturnAli produceEBAli(const EBAlignmentRcd &)
static unsigned int numberOfAlignments()
ReturnAliErr produceEEAliErr(const EEAlignmentErrorExtendedRcd &)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:71
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
AlignTransform::Translation Trl
ReturnAli produceZdcAli(const ZDCAlignmentRcd &)
ReturnAliErr produceZdcAliErr(const ZDCAlignmentErrorExtendedRcd &)
ReturnAli produceHEAli(const HEAlignmentRcd &)
FakeCaloAlignmentEP(const edm::ParameterSet &)
ReturnAliErr produceHFAliErr(const HFAlignmentErrorExtendedRcd &)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:73
ReturnAliErr produceCastorAliErr(const CastorAlignmentErrorExtendedRcd &)
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
ReturnAliErr produceESAliErr(const ESAlignmentErrorExtendedRcd &)
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
std::unique_ptr< AlignmentErrors > ReturnAliErr
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