ATLAS Offline Software
Public Member Functions | List of all members
ComputeStaveServices Class Reference

#include <ComputeStaveServices.h>

Collaboration diagram for ComputeStaveServices:

Public Member Functions

 ComputeStaveServices ()
 
StaveServices compute (DetType::Type, DetType::Part, int layerNumber, int nModulesPerStave, int nChipsPerModule, MsgStream &msg) const
 
int computeLVGaugeSerial (DetType::Type, DetType::Part, int layerNumber, int nModules, double moduleCurrent, double moduleVoltage, double poweringLoss, double lossInCable, double cableLen, MsgStream &msg) const
 

Detailed Description

Definition at line 11 of file ComputeStaveServices.h.

Constructor & Destructor Documentation

◆ ComputeStaveServices()

ComputeStaveServices::ComputeStaveServices ( )
inline

Definition at line 14 of file ComputeStaveServices.h.

14 {}

Member Function Documentation

◆ compute()

StaveServices ComputeStaveServices::compute ( DetType::Type  type,
DetType::Part  part,
int  layerNumber,
int  nModulesPerStave,
int  nChipsPerModule,
MsgStream &  msg 
) const

Definition at line 10 of file ComputeStaveServices.cxx.

14 {
15  msg << MSG::DEBUG << "Computing services for " << DetType::name( type, part) << " layer " << layerNumber
16  << " with " << nModulesPerStave << " modulesPerStave and "
17  << nChipsPerModule << " chipsPerModule" << endmsg;
18 
19  // The input parameters to the calculation of services per stave.
20  // FIXME: They must be eventually stored in the DB, and not hard-wired in the code
21 
22  const int HV_grouping = 4; // FIXME: hard-wired number
23  const int nDCS_Pixel = 10; // FIXME: hard-wired number
24  const int nDCS_Strip = 10; // FIXME: hard-wired number
25  const int max_SP_group_size = 8; // FIXME: hard-wired number
26 
27  // HV part
28  int nHV = nModulesPerStave / HV_grouping;
29  if (nModulesPerStave % HV_grouping != 0) ++nHV;
30 
31  // DCS part
32  int nDCS;
33  if ( type == DetType::Pixel) {
34  nDCS = nDCS_Pixel; // FIXME
35  }
36  else {
37  nDCS = nDCS_Strip;
38  }
39 
40  // Data part
41  int Data_grouping = 10; // FIXME: hard-wired number
42  if (layerNumber > 2) Data_grouping = 20; // FIXME: hard-wired number
43  int nChips = nModulesPerStave * nChipsPerModule;
44  int nData = nChips/Data_grouping;
45  if (nChips % Data_grouping != 0) ++nData;
46 
47  // LV part
48  double chipCurrent = 0.5; // FIXME: hard-wired number
49  double chipVoltage = 2.4; // FIXME: hard-wired number
50  double poweringLoss = 0.2; // FIXME: hard-wired number
51  double lossInCable = 0.1; // FIXME: hard-wired number
52  double cableLen = 3.0; // FIXME: hard-wired number
53 
54  double moduleCurrent = chipCurrent * nChipsPerModule; // chips are powered in parallel inside a pixel module
55  double moduleVoltage = chipVoltage;
56 
57  int nGroups = 1;
58  int nModules = nModulesPerStave;
59 
60  if (nModulesPerStave > max_SP_group_size) {
61  nGroups = nModulesPerStave / max_SP_group_size;
62  if (nModulesPerStave % max_SP_group_size != 0) nGroups++;
63  nModules = max_SP_group_size;
64  msg << MSG::DEBUG << "Using " << nGroups << " powering groups with " << max_SP_group_size << " modules each" << endl;
65  }
66 
67  int lvGauge = computeLVGaugeSerial( type, part, layerNumber,
68  nModules, moduleCurrent, moduleVoltage,
69  poweringLoss, lossInCable, cableLen,
70  msg);
71 
72  std::vector<int> lvg( nGroups, lvGauge);
73  return StaveServices( type, part, layerNumber, nHV, nDCS, nData, lvg);
74 }

◆ computeLVGaugeSerial()

int ComputeStaveServices::computeLVGaugeSerial ( DetType::Type  type,
DetType::Part  part,
int  layerNumber,
int  nModules,
double  moduleCurrent,
double  moduleVoltage,
double  poweringLoss,
double  lossInCable,
double  cableLen,
MsgStream &  msg 
) const

Definition at line 92 of file ComputeStaveServices.cxx.

96 {
97  /*
98  cout << "computeLVGaugeSerial: nModules = " << nModules
99  << " moduleCurrent " << moduleCurrent
100  << " moduleVoltage " << moduleVoltage
101  << " poweringLoss " << poweringLoss
102  << " lossInCable " << lossInCable
103  << " cableLen " << cableLen
104  << endl;
105  */
106  // serial powering
107  double cableCurrent = moduleCurrent;
108  double staveVoltage = moduleVoltage * nModules / (1.-poweringLoss);
109  double stavePower = cableCurrent*staveVoltage;
110  double cablePowerDissipation = stavePower * lossInCable;
111  if (cablePowerDissipation < 2.) cablePowerDissipation = 2.; // we can always accept 2 W power loss in cable
112 
113  double cableResistivity = cablePowerDissipation / (cableCurrent*cableCurrent);
114  double resistivityPerMeter = cableResistivity / (2*cableLen);
115 
116  int gauge = ccaw::closestResistivityCcawGauge( resistivityPerMeter);
117 
118  msg << MSG::DEBUG << DetType::name( type, part) << " layer " << layerNumber
119  << " SP loop power " << stavePower << " [W], current " << moduleCurrent
120  // << " [A], cablePowerLoss " << cablePowerDissipation
121  << " [W], desired resistivity " << resistivityPerMeter
122  << " [Ohm/m], closest gauge " << gauge << endl;
123 
124  return gauge;
125 }

The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
StaveServices
Class storing all the services of a stave (or a petal, etc...) classifying them by function and by nu...
Definition: StaveServices.h:15
PixelModuleFeMask_create_db.nModules
nModules
Definition: PixelModuleFeMask_create_db.py:47
DetType::Pixel
@ Pixel
Definition: DetType.h:13
DetType::name
std::string name(Type t)
Definition: DetType.h:16
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ccaw::closestResistivityCcawGauge
int closestResistivityCcawGauge(double res)
Definition: CcawUtils.h:50
ComputeStaveServices::computeLVGaugeSerial
int computeLVGaugeSerial(DetType::Type, DetType::Part, int layerNumber, int nModules, double moduleCurrent, double moduleVoltage, double poweringLoss, double lossInCable, double cableLen, MsgStream &msg) const
Definition: ComputeStaveServices.cxx:92
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7