ATLAS Offline Software
Loading...
Searching...
No Matches
VP1CaloCells.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 VP1CALOSYSTEMS_VP1CALOCELL_H
6#define VP1CALOSYSTEMS_VP1CALOCELL_H
7
9
10#include "Identifier/Identifier.h"
12
14#include "GeoModelKernel/GeoDefinitions.h"
15#include "GaudiKernel/SystemOfUnits.h"
16
17#include <map>
18#include <set>
19#include <vector>
20#include <string>
21#include <QMap>
22#include <QPair>
23#include <QList>
24
26class SoSeparator;
27class SoNode;
28class SoGenericBox;
29class CaloCell;
30class CaloCell_ID;
31class TileID;
32class TileHWID;
33class TileTBID;
34class TileCell;
35
36class TileDigits;
37class TileInfo;
38class LArDigit;
41
42class QCheckBox;
43class QDoubleSpinBox;
44
45// Structure for global cuts
47{
48 public:
49
50 bool operator == (const VP1CC_GlobalCuts& other) const {return sideA==other.sideA
51 && sideC==other.sideC
52 && allowedEta==other.allowedEta
53 && allowedPhi==other.allowedPhi; }
54
55 bool sideA;
56 bool sideC;
58 QList<VP1Interval> allowedPhi;
59 double clipRadius;
60};
61
62// ************* Enums *****************
63// Positions of bits in the regular selection bitmaps
64
65// Selection types
87
88// Separator types
107
108// Separator map
109typedef std::map<VP1CC_SeparatorTypes, VP1ExtraSepLayerHelper*, std::less<VP1CC_SeparatorTypes> > VP1CC_SeparatorMap;
110
111// Set of keys for the instances of above map
112typedef std::set<VP1CC_SeparatorTypes> VP1CC_SeparatorTypesSet;
113
114// Pair of intervals for selecting cells with pos/neg energies kept within Cell Managers
115typedef QPair<VP1Interval,VP1Interval> VP1CCIntervalPair;
116
117// Map of interval pairs by Selection types. Is transferred from the Controller to CellManagers when
118// selection chenges in GUI. The managers should be able to find their corresponding pair by themselves
119typedef QMap<VP1CC_SelectionTypes,VP1CCIntervalPair> VP1CCIntervalMap;
120
121// Helper structure, collects all interface objects needed by VP1CaloCellManager
122typedef struct
123{
124 const QCheckBox* globalEnableCB; // Display/hide subsystem
125 const QCheckBox* showNegativeCB; // Display/hide negative energy cells
126 const QCheckBox* upperThreshOffCB; // Disable/enable upper energy threshold
127
128 const QDoubleSpinBox* lowerThresholdSB; // Lower threshold
129 QDoubleSpinBox* upperThresholdSB; // Upper threshold
130
132
133// This map is used by the Calo Cell Controller
134// It keeps two objects of this type, one for simple and one for expert mode
135typedef std::map<VP1CC_SelectionTypes,VP1CCUi2Manager*> VP1CCSelectionType2GuiMap;
136
137// *********** Classes ************************
138
139//
140// Base class which has Calo subsystem specific sub-classes.
141// The following diagram shows class hierarchy
142//
143// VP1CaloCell
144// |------VP1CC_LAr
145// | |----VP1CC_LArEMB
146// | |----VP1CC_LArEMECHEC
147// | |----VP1CC_LArFCAL
148// |
149// |------VP1CC_Tile
150// |------VP1CC_Tile
151//
152//
153// The sub-classes differ
154// in the way they create 3D objects corresponding to CaloCell
155//
156class VP1CaloCell;
157typedef std::map<SoNode*, VP1CaloCell*, std::less<SoNode*> > VP1CC_SoNode2CCMap;
158
160{
161 public:
162 VP1CaloCell(const CaloCell* caloCell);
163 virtual ~VP1CaloCell();
164
165 double energyToTransverse(const double&) const;
166
167 bool cutPassed(const VP1CC_GlobalCuts& globalCuts);
168
169 // Get Cell
170 const CaloCell* getCaloCell();
171
172 // Get Cell identifier
174
175 void updateScene(VP1CC_SoNode2CCMap* node2cc,
176 bool useEt,
177 const QPair<bool,double>& scale,
178 bool outline,
179 const VP1CC_GlobalCuts& globalCuts);
180
181
182 // Build 3D object(s)
183 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
184 bool useEt,
185 const QPair<bool,double>& scale,
186 bool outline,
187 const VP1CC_GlobalCuts& ) = 0;
188
189 double cellDepth(const QPair<bool,double>& scale, const double& energy)
190 { return std::max(1.0*Gaudi::Units::mm,scale.second*(scale.first?log(1+fabs(energy)):fabs(energy))); }
191
192 virtual bool isInsideClipVolume(const VP1CC_GlobalCuts& globalCuts) ; // by default uses radius to determine this
193
194 // Remove 3D object(s) from scene
195 virtual void remove3DObjects(VP1CC_SoNode2CCMap* node2cc) = 0;
196
197 // Create a string with cell specific information
198 // For Tile Barrel & EC cells print both PMT specific info no matter which hit has been selected
199 // Input parameter:
200 // calo_id: ID helper, needed to decode Cell ID
201 virtual std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="") = 0;
202
203 protected:
204 const CaloCell* m_caloCell; // Pointer to Calo Cell
205
206};
207
208//
209// *** *** *** LAr *** *** ***
210//
211class VP1CC_LAr : public VP1CaloCell
212{
213 public:
214 VP1CC_LAr(const CaloCell* caloCell);
215 virtual ~VP1CC_LAr();
216
217 virtual void remove3DObjects(VP1CC_SoNode2CCMap* node2cc);
218
219 protected:
222};
223
224
225//
226// *************** LArEMB ************************
227//
228
230{
231 public:
232 VP1CC_LArEMB(const CaloCell* caloCell,
233 const VP1CC_SeparatorMap* separators);
234 virtual ~VP1CC_LArEMB();
235
236 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
237 bool useEt,
238 const QPair<bool,double>& scale,
239 bool outline,
240 const VP1CC_GlobalCuts& );
241
242 std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="");
243};
244
245//
246// *************** LArEMECHEC ************************
247//
248
250{
251 public:
252 VP1CC_LArEMECHEC(const CaloCell* caloCell,
253 const CaloCell_ID* calo_id,
254 const VP1CC_SeparatorMap* separators);
255
256 virtual ~VP1CC_LArEMECHEC();
257
258 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
259 bool useEt,
260 const QPair<bool,double>& scale,
261 bool outline,
262 const VP1CC_GlobalCuts& );
263
264 std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="");
265
266};
267
268//
269// *************** LArFCAL ************************
270//
271
273{
274 public:
275 VP1CC_LArFCAL(const CaloCell* caloCell,
276 const VP1CC_SeparatorMap* separators);
277
278 virtual ~VP1CC_LArFCAL();
279
280 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
281 bool useEt,
282 const QPair<bool,double>& scale,
283 bool outline,
284 const VP1CC_GlobalCuts& );
285
286 std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="");
287
288};
289
290//
291// *********** Tile Base Class ****************
292//
294{
295 public:
296 VP1CC_Tile(const CaloCell* caloCell,
297 const TileID* tile_id);
298 virtual ~VP1CC_Tile();
299
300 // return == 0 for OK
301 virtual int GetFragChannel(const TileHWID* tile_hw_id,
302 bool up, // false - onl1, true - onl2
303 int& frag,
304 int& channel) = 0;
305
306 protected:
308};
309
310//
311// *** *** *** Tile Barrel & EC *** *** ***
312//
314{
315 public:
316 VP1CC_TileBarEc(const CaloCell* caloCell,
317 const TileID* tile_id,
318 const VP1CC_SeparatorMap* separators);
319 virtual ~VP1CC_TileBarEc();
320
321 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
322 bool useEt,
323 const QPair<bool,double>& scale,
324 bool outline,
325 const VP1CC_GlobalCuts& );
326
327 bool isInsideClipVolume(const VP1CC_GlobalCuts& globalCuts);
328
329 virtual void remove3DObjects(VP1CC_SoNode2CCMap* node2cc);
330
331 std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="");
332
333 int GetFragChannel(const TileHWID* tile_hw_id,
334 bool up,
335 int& frag,
336 int& channel);
337
338 protected:
343
344 std::string id2name(Identifier& id);
345};
346
347//
348// *** *** *** Tile Crack *** *** ***
349//
351{
352 public:
353 VP1CC_TileCrack(const CaloCell* caloCell,
354 const TileID* tile_id,
355 const VP1CC_SeparatorMap* separators);
356
357 virtual ~VP1CC_TileCrack();
358
359 virtual void build3DObjects(VP1CC_SoNode2CCMap* node2cc,
360 bool useEt,
361 const QPair<bool,double>& scale,
362 bool outline,
363 const VP1CC_GlobalCuts& );
364
365 bool isInsideClipVolume(const VP1CC_GlobalCuts& globalCuts);
366
367 virtual void remove3DObjects(VP1CC_SoNode2CCMap* node2cc);
368
369 std::vector<std::string> ToString(const CaloCell_ID* calo_id, const std::string& extrainfos="");
370
371 int GetFragChannel(const TileHWID* tile_hw_id,
372 bool up,
373 int& frag,
374 int& channel);
375 protected:
378};
379
380// ---------------------------------------------------
381//
382// *** *** MBTS *** ***
383//
384// ---------------------------------------------------
385
386// Data structures needed to keep following information:
387//
388// 1. MBTS scintillator shape parameters (2 different shapes)
389// 2. MBTS scintillator global positions
390
391typedef std::map<int, GeoTrf::Transform3D, std::less<int> > VP1CC_MbtsXfMap;
392
393typedef struct
394{
395 double dx1; //-|
396 double dx2; // |
397 double dy1; // |-Scintillator shape parameters
398 double dy2; // |
399 double dz; //-|
400 VP1CC_MbtsXfMap aTransforms; // Absolute positions on the A side
401 VP1CC_MbtsXfMap cTransforms; // Absolute positions on the C side
403
404// The instance of this map contains 2 elements
405// 0 - scintillators at lower R
406// 1 - scintillators at higher R
407typedef std::map<int, VP1CC_MbtsScinInfo*, std::less<int> > VP1CC_MbtsScinInfoMap;
408
409class VP1Mbts;
410typedef std::map<SoNode*, VP1Mbts*, std::less<SoNode*> > VP1CC_SoNode2MbtsMap;
411
413{
414 public:
415 VP1Mbts(const TileCell* cell,
416 const TileTBID* idhelper,
417 SoSeparator* separator,
418 bool run2Geo);
419 ~VP1Mbts();
420
421 // Update graphics scene according to the trivial energy threshold criterion
422 // Return true if the new object has been created
423 bool UpdateScene(VP1CC_MbtsScinInfoMap* drawinfo,
424 VP1CC_SoNode2MbtsMap* node2mbts,
425 double energy,
426 bool outline,
427 double clipRadius);
428
429 // Print out cell information to the vector of strings
430 std::vector<std::string> ToString();
431
432
433 private:
434 const TileCell* m_cell; // Pointer to the Cell object (TileCell)
435 const TileTBID* m_idhelper; // Tile TB id helper
436 SoSeparator* m_separator; // Separator helper
437 bool m_run2Geo; // RUN2 geometry: the readout granularity of MBTS2 changes from 8 to 4
438};
439
440#endif
std::map< VP1CC_SelectionTypes, VP1CCUi2Manager * > VP1CCSelectionType2GuiMap
std::map< int, VP1CC_MbtsScinInfo *, std::less< int > > VP1CC_MbtsScinInfoMap
VP1CC_SeparatorTypes
@ VP1CC_SepTileNegativeDown
@ VP1CC_SepTilePositiveDown
@ VP1CC_SepLArEMBPos
@ VP1CC_SepLArHECNeg
@ VP1CC_SepLArFCALPos
@ VP1CC_SepLArEMECPos
@ VP1CC_SepMBTS
@ VP1CC_SepTilePositiveNeg
@ VP1CC_SepLArEMECNeg
@ VP1CC_SepTilePositiveUp
@ VP1CC_SepLArEMBNeg
@ VP1CC_SepLArHECPos
@ VP1CC_SepTileNegativePos
@ VP1CC_SepTileNegativeUp
@ VP1CC_SepLArFCALNeg
std::map< SoNode *, VP1Mbts *, std::less< SoNode * > > VP1CC_SoNode2MbtsMap
QPair< VP1Interval, VP1Interval > VP1CCIntervalPair
std::map< VP1CC_SeparatorTypes, VP1ExtraSepLayerHelper *, std::less< VP1CC_SeparatorTypes > > VP1CC_SeparatorMap
QMap< VP1CC_SelectionTypes, VP1CCIntervalPair > VP1CCIntervalMap
VP1CC_SelectionTypes
@ VP1CC_SelTypeEMB2
@ VP1CC_SelTypeEMEC1
@ VP1CC_SelTypeFCAL3
@ VP1CC_SelTypeTileB
@ VP1CC_SelTypeEMEC3
@ VP1CC_SelTypeFCAL1
@ VP1CC_SelTypeHEC0
@ VP1CC_SelTypeHEC2
@ VP1CC_SelTypeTileEC
@ VP1CC_SelTypeEMB3
@ VP1CC_SelTypeEMEC0
@ VP1CC_SelTypeEMB0
@ VP1CC_SelTypeFCAL2
@ VP1CC_SelTypeEMB1
@ VP1CC_SelTypeEMEC2
@ VP1CC_SelTypeHEC3
@ VP1CC_SelTypeHEC1
@ VP1CC_SelTypeTileCrack
std::map< SoNode *, VP1CaloCell *, std::less< SoNode * > > VP1CC_SoNode2CCMap
std::map< int, GeoTrf::Transform3D, std::less< int > > VP1CC_MbtsXfMap
std::set< VP1CC_SeparatorTypes > VP1CC_SeparatorTypesSet
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
Liquid Argon digit base class.
Definition LArDigit.h:25
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
QList< VP1Interval > allowedPhi
bool operator==(const VP1CC_GlobalCuts &other) const
VP1Interval allowedEta
virtual ~VP1CC_LArEMB()
VP1CC_LArEMB(const CaloCell *caloCell, const VP1CC_SeparatorMap *separators)
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")
virtual ~VP1CC_LArEMECHEC()
VP1CC_LArEMECHEC(const CaloCell *caloCell, const CaloCell_ID *calo_id, const VP1CC_SeparatorMap *separators)
std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")
virtual ~VP1CC_LArFCAL()
VP1CC_LArFCAL(const CaloCell *caloCell, const VP1CC_SeparatorMap *separators)
virtual ~VP1CC_LAr()
VP1ExtraSepLayerHelper * m_helper
VP1CC_LAr(const CaloCell *caloCell)
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)
SoGenericBox * m_hit
int GetFragChannel(const TileHWID *tile_hw_id, bool up, int &frag, int &channel)
SoGenericBox * m_hitDown
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
SoGenericBox * m_hitUp
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)
VP1ExtraSepLayerHelper * m_helperUp
VP1CC_TileBarEc(const CaloCell *caloCell, const TileID *tile_id, const VP1CC_SeparatorMap *separators)
std::string id2name(Identifier &id)
bool isInsideClipVolume(const VP1CC_GlobalCuts &globalCuts)
std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")
virtual ~VP1CC_TileBarEc()
VP1ExtraSepLayerHelper * m_helperDown
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)
VP1CC_TileCrack(const CaloCell *caloCell, const TileID *tile_id, const VP1CC_SeparatorMap *separators)
int GetFragChannel(const TileHWID *tile_hw_id, bool up, int &frag, int &channel)
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
SoGenericBox * m_hit
VP1ExtraSepLayerHelper * m_helper
virtual ~VP1CC_TileCrack()
bool isInsideClipVolume(const VP1CC_GlobalCuts &globalCuts)
std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")
virtual ~VP1CC_Tile()
virtual int GetFragChannel(const TileHWID *tile_hw_id, bool up, int &frag, int &channel)=0
VP1CC_Tile(const CaloCell *caloCell, const TileID *tile_id)
const TileID * m_tileID
void updateScene(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &globalCuts)
const CaloCell * m_caloCell
VP1CaloCell(const CaloCell *caloCell)
double energyToTransverse(const double &) const
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)=0
virtual bool isInsideClipVolume(const VP1CC_GlobalCuts &globalCuts)
const CaloCell * getCaloCell()
double cellDepth(const QPair< bool, double > &scale, const double &energy)
virtual std::vector< std::string > ToString(const CaloCell_ID *calo_id, const std::string &extrainfos="")=0
virtual ~VP1CaloCell()
bool cutPassed(const VP1CC_GlobalCuts &globalCuts)
Identifier getID()
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)=0
std::vector< std::string > ToString()
SoSeparator * m_separator
bool m_run2Geo
const TileCell * m_cell
bool UpdateScene(VP1CC_MbtsScinInfoMap *drawinfo, VP1CC_SoNode2MbtsMap *node2mbts, double energy, bool outline, double clipRadius)
const TileTBID * m_idhelper
VP1Mbts(const TileCell *cell, const TileTBID *idhelper, SoSeparator *separator, bool run2Geo)
const QCheckBox * upperThreshOffCB
const QCheckBox * globalEnableCB
const QCheckBox * showNegativeCB
const QDoubleSpinBox * lowerThresholdSB
QDoubleSpinBox * upperThresholdSB
VP1CC_MbtsXfMap cTransforms
VP1CC_MbtsXfMap aTransforms