ATLAS Offline Software
InDetRawDataFakeCreator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SRC_INDETRAWDATAFAKECREATOR_H
6 # define SRC_INDETRAWDATAFAKECREATOR_H
7 
28 //<<<<<< INCLUDES >>>>>>
29 
34 #include "InDetIdentifier/SCT_ID.h"
35 #include "InDetIdentifier/TRT_ID.h"
36 #include "GaudiKernel/MsgStream.h"
37 
38 //<<<<<< CLASS DECLARATIONS >>>>>>
39 
41 {
42 public:
43 
46 
50  const PixelID* pixelId,
51  MsgStream& log);
52 
56  const SCT_ID* sctId,
57  MsgStream& log);
58 
62  const TRT_ID* trtId,
63  MsgStream& log);
64 };
65 
66 
67 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
68 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
69 
71 {
72 }
73 
74 
77  const PixelID* pixelId,
78  MsgStream& log)
79 {
80 
81  // create a new pixel RDO collection
84 
85  IdContext cntx(pixelId->wafer_context());
86 
87  // need the DE identifier
88  Identifier waferId = pixelId->wafer_id (hashId);
89  rdocoll->setIdentifier(waferId);
90 
91  log << MSG::VERBOSE << "hash, id1, id2: "
92  << MSG::hex << (unsigned int)hashId << MSG::dec << " "
93  << MSG::hex << waferId << MSG::dec << " "
94  << MSG::hex << pixelId->wafer_id(hashId) << MSG::dec << " "
95  << pixelId->show_to_string(waferId) << " "
96  << pixelId->show_to_string(pixelId->wafer_id(hashId)) << " "
97  << endmsg;
98 
99  int deltaPhi = pixelId->phi_index_max(waferId)/6;
100  int deltaEta = pixelId->eta_index_max(waferId)/6;
101  log << MSG::VERBOSE << "phi max, eta max, dphi, deta: "
102  << pixelId->phi_index_max(waferId) << " "
103  << pixelId->eta_index_max(waferId) << " "
104  << deltaPhi << " "
105  << deltaEta << " "
106  << endmsg;
107 
108  int phi = deltaPhi;
109  // loop on 16 digits
110  for (int j = 0; j < 4; ++j, phi += deltaPhi) {
111  int eta = deltaEta;
112  for (int k = 0; k < 4; ++k, eta += deltaEta) {
113 
114  Identifier id_readout = pixelId->pixel_id(waferId, phi, eta);
115  const unsigned int mo = (1 & 0x1F) << 27;
116  const unsigned int fe2 =(1 & 0xF) << 21;
117  const unsigned int row2=(1 & 0xFF) << 13;
118  const unsigned int col2=(1 & 0x1F) << 8;
119  const unsigned int tot =(5 & 0xFF);
120  unsigned int pixelWord = (mo|fe2|row2|col2|tot);
121 
122  Pixel1RawData *rdo= new Pixel1RawData(id_readout, pixelWord);
123  if (rdo) {
124  rdocoll->push_back(rdo);
125 
126  } else {
127  log << MSG::ERROR << "Could not create Pixel1RawData object !"
128  << endmsg;
129  }
130  // Print out contents of RDO
131  log << MSG::VERBOSE << "Created RDO: "
132  << pixelId->show_to_string(rdo->identify()) << " "
133  << MSG::hex << rdo->getWord() << endmsg;
134  }
135  }
136 
137  return (rdocoll);
138 }
139 
142  const SCT_ID* sctId,
143  MsgStream& log)
144 {
145  // create a new sct RDO collection
148 
149  IdContext cntx(sctId->wafer_context());
150 
151  // need the DE identifier
152  Identifier waferId = sctId->wafer_id (hashId);
153  rdocoll->setIdentifier(waferId);
154 
155  int deltaStrip = sctId->strip_max(waferId)/6;
156  log << MSG::VERBOSE << "strip max, dstrip: "
157  << sctId->strip_max(waferId) << " "
158  << deltaStrip << " "
159  << endmsg;
160 
161  int strip = deltaStrip;
162  // loop on 4 digits
163  for (int j = 0; j < 4; ++j, strip += deltaStrip) {
164 
165  Identifier id_readout = sctId->strip_id(waferId, strip);
166  const unsigned int str =(strip) << 16;
167  const unsigned int group = 4;
168  unsigned int word= (group|str);
169 
170  SCT1_RawData *rdo= new SCT1_RawData(id_readout, word);
171  if (rdo) {
172  rdocoll->push_back(rdo);
173 
174  } else {
175  log << MSG::ERROR << "Could not create SCT1_RawData object !"
176  << endmsg;
177  }
178  // Print out contents of RDO
179  log << MSG::VERBOSE << "Created RDO: "
180  << sctId->show_to_string(rdo->identify()) << " "
181  << MSG::hex << rdo->getWord() << endmsg;
182  }
183 
184  return (rdocoll);
185 }
186 
187 
190  const TRT_ID* trtId,
191  MsgStream& log)
192 {
193  // create a new trt RDO collection
196 
197  IdContext cntx(trtId->straw_layer_context());
198 
199  // need the DE identifier
200  Identifier strLayId = trtId->layer_id (hashId);
201  rdocoll->setIdentifier(strLayId);
202 
203  int deltaStraw = trtId->straw_max(strLayId)/6;
204  log << MSG::VERBOSE << "straw max, dstraw: "
205  << trtId->straw_max(strLayId) << " "
206  << deltaStraw << " "
207  << endmsg;
208 
209  int straw = deltaStraw;
210  // loop on 16 digits
211  for (int j = 0; j < 4; ++j, straw += deltaStraw) {
212 
213  Identifier id_readout = trtId->straw_id(strLayId, straw);
214  unsigned int trtWord= (0xFFFFFFFF);
215 
216  TRT_LoLumRawData *rdo= new TRT_LoLumRawData(id_readout, trtWord);
217  if (rdo) {
218  rdocoll->push_back(rdo);
219 
220  } else {
221  log << MSG::ERROR << "Could not create TRT_LoLumRawData object !"
222  << endmsg;
223  }
224  // Print out contents of RDO
225  log << MSG::VERBOSE << "Created RDO: "
226  << trtId->show_to_string(rdo->identify()) << " "
227  << MSG::hex << rdo->getWord() << endmsg;
228  }
229  return (rdocoll);
230 }
231 
232 
233 
234 #endif // SRC_INDETRAWDATAFAKECREATOR_H
235 
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
InDetRawDataFakeCreator
Class which encapsulates the creation of an InDetRawDataCollection.
Definition: InDetRawDataFakeCreator.h:41
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
SiliconTech::strip
@ strip
TRT_ID::straw_max
int straw_max(const Identifier &id) const
Definition: TRT_ID.cxx:803
InDetRawDataCollection::setIdentifier
void setIdentifier(Identifier id)
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TRT_LoLumRawData
Definition: TRT_LoLumRawData.h:25
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
TRT_RDO_Collection.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
InDetRawDataFakeCreator::InDetRawDataFakeCreator
InDetRawDataFakeCreator()
Default constructor.
Definition: InDetRawDataFakeCreator.h:70
PixelID::phi_index_max
int phi_index_max(const Identifier &id) const
Definition: PixelID.cxx:141
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:66
PixelRDO_Collection.h
PixelID::eta_index_max
int eta_index_max(const Identifier &id) const
Definition: PixelID.cxx:160
TRT_ID::straw_layer_context
IdContext straw_layer_context(void) const
straw_layer id
Definition: TRT_ID.h:713
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
InDetRawDataFakeCreator::createSCT_RawDataColl
const InDetRawDataCollection< SCT_RDORawData > * createSCT_RawDataColl(IdentifierHash hashId, const SCT_ID *sctId, MsgStream &log)
Create SCT_RawDataCollection.
Definition: InDetRawDataFakeCreator.h:141
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
InDetRawDataFakeCreator::createTRT_RawDataColl
const InDetRawDataCollection< TRT_RDORawData > * createTRT_RawDataColl(IdentifierHash hashId, const TRT_ID *trtId, MsgStream &log)
Create TRT_RawDataCollection.
Definition: InDetRawDataFakeCreator.h:189
Pixel1RawData
Definition: Pixel1RawData.h:23
SCT_ID::wafer_context
IdContext wafer_context(void) const
Definition: SCT_ID.h:705
SCT_RDO_Collection.h
DataVector< RawDataT >::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TRT_ID
Definition: TRT_ID.h:84
InDetRawData::getWord
unsigned int getWord() const
Definition: InDetRawData.h:47
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
PixelID::wafer_context
IdContext wafer_context(void) const
Definition: PixelID.h:590
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
SCT_ID
Definition: SCT_ID.h:68
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:432
SCT_ID::strip_max
int strip_max(const Identifier &id) const
Definition: SCT_ID.cxx:196
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SCT1_RawData
Definition: SCT1_RawData.h:27
str
Definition: BTagTrackIpAccessor.cxx:11
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
PixelID
Definition: PixelID.h:67
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
InDetRawDataFakeCreator::createPixelRawDataColl
const InDetRawDataCollection< PixelRDORawData > * createPixelRawDataColl(IdentifierHash hashId, const PixelID *pixelId, MsgStream &log)
Create PixelRawDataCollection.
Definition: InDetRawDataFakeCreator.h:76
fitman.k
k
Definition: fitman.py:528
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581
SCT_ID::strip_id
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
Definition: SCT_ID.h:535
Identifier
Definition: IdentifierFieldParser.cxx:14