StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSstConfig.cc
1 //$Id: StSstConfig.cc,v 1.2 2016/06/06 18:48:12 bouchet Exp $
2 //
3 //$Log: StSstConfig.cc,v $
4 //Revision 1.2 2016/06/06 18:48:12 bouchet
5 //coverity : UNINIT_CTOR
6 //
7 //Revision 1.1 2015/06/23 16:26:20 jeromel
8 //First version created from the SSD code and reshaped
9 //
10 //Revision 1.1 2015/04/19 17:30:31 bouchet
11 //initial commit ; SST codes
12 //
13 
14 //fork from the SSD code, move along - see history therein
15 
16 #include "StSstConfig.hh"
17 #include "StMessMgr.h"
18 
19 #include "tables/St_ssdConfiguration_Table.h"
20 
21 ClassImp(StSstConfig)
22 
24  :totLadderPresent(-1956) // Number of Present Ladders
25  ,mNumberOfLadders(-1956) // Number of Present Ladders
26  ,mNumberOfWafers(-1956) // Number of Wafers of each Ladder (Barrel dependent)
27  ,mNumberOfHybrids(-1956) // Number of Hybrids of each Wafer
28  ,mTotalNumberOfLadders(-1956) // Total Number of Ladders (entire SSD)
29  ,mTotalNumberOfHybrids(-1956) // Total Number of Hybrids (entire SSD)
30  ,mNumberOfStrips(-1956) // Number of Strips in one hybrid
31 
32 { memset(mStatus,-1,sizeof(mStatus)); }
33 
34 StSstConfig::~StSstConfig()
35 {}
36 
37 StSstConfig::StSstConfig(const StSstConfig& geom){
38  totLadderPresent = geom.mNumberOfLadders;
39  mNumberOfLadders = geom.mNumberOfLadders;
40  mNumberOfWafers = geom.mNumberOfWafers;
41  mNumberOfHybrids = geom.mNumberOfHybrids;
42  mNumberOfStrips = geom.mNumberOfStrips;
43  mTotalNumberOfLadders = geom.mTotalNumberOfLadders;
44  mTotalNumberOfHybrids = geom.mTotalNumberOfHybrids;
45 }
46 
47 StSstConfig& StSstConfig::operator = (const StSstConfig& geom)
48 {
49  return *this;
50 }
51 
52 void StSstConfig::setConfiguration()
53 {
54  if ((totLadderPresent == 1)) // LADDER 0
55  mConfig = TString("LAD0");
56  else if (totLadderPresent == 10) // HALF SSD
57  mConfig = TString("HALF");
58  else if (totLadderPresent == 20) // FULL SSD
59  mConfig = TString("FULL");
60  else
61  mConfig = TString("NULL");
62 }
63 
64 void StSstConfig::setConfiguration(const char* config)
65 {
66  // set the Collection configuration
67 
68  mConfig = TString(config);
69 
70  if ( !strncmp(config, "HALF", strlen("HALF")) ) {
71  setNumberOfLadders(10);
72  setNumberOfWafers(160);
73  setNumberOfHybrids(2);
74  setTotalNumberOfHybrids(320);
75  } else if ( !strncmp(config, "FULL", strlen("FULL")) ) {
76  setNumberOfLadders(20);
77  setNumberOfWafers(320);
78  setNumberOfHybrids(2);
79  setTotalNumberOfHybrids(640);
80  } else {
81  LOG_ERROR << "Configuration of SSD not defined! It must be LAD0 or HALF or FULL "<< endm;
82  }
83 }
84 
85 const char* StSstConfig::getConfiguration()
86 {
87  return mConfig.Data();
88 }
89 
90