CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TofID Class Reference

#include <TofID.h>

+ Inheritance diagram for TofID:

Public Types

typedef Identifier::size_type size_type
 
typedef Identifier::value_type value_type
 

Public Member Functions

 TofID ()
 constructor
 
 ~TofID ()
 destructor
 
int phi_module_max (const Identifier &id)
 Max/Min values for each field (error returns -999)
 
int layer_max (const Identifier &id)
 
- Public Member Functions inherited from BesDetectorID
 BesDetectorID (void)
 
 ~BesDetectorID (void)
 
Identifier mdc (void) const
 
Identifier tof (void) const
 
Identifier emc (void) const
 
Identifier muc (void) const
 
Identifier hlt (void) const
 
Identifier mrpc (void) const
 
Identifier cgem (void) const
 
bool is_mdc (const Identifier &id) const
 
bool is_tof (const Identifier &id) const
 
bool is_emc (const Identifier &id) const
 
bool is_muc (const Identifier &id) const
 
bool is_hlt (const Identifier &id) const
 
bool is_mrpc (const Identifier &id) const
 
bool is_cgem (const Identifier &id) const
 

Static Public Member Functions

static Identifier cell_id (int barrel_ec, int layer, int phi_module, int end)
 For a single crystal.
 
static value_type getIntID (int barrel_ec, int layer, int phi_module, int end)
 
static value_type getLAYER_BARREL_MAX ()
 
static value_type getLAYER_ENDCAP_MAX ()
 
static value_type getPHI_BARREL_MAX ()
 
static value_type getPHI_ENDCAP_MAX ()
 
static value_type getBARREL_EC_MAX ()
 
static value_type getBARREL_EC_MIN ()
 
static bool values_ok (const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int)
 
static bool values_ok_mrpc (const unsigned int partID, const unsigned int scinNum)
 
static bool values_ok_mrpc_mc (const unsigned int partID, const unsigned int scinNum)
 
static Identifier cell_id_mrpc (int partID, int scinNum)
 
static Identifier cell_id_mrpc_mc (int partID, int scinNum)
 
static bool is_mymrpc (const Identifier &id)
 
static value_type getIntID_mrpc (int partID, int scinNum)
 
static Identifier cell_id (int value)
 
static bool is_barrel (const Identifier &id)
 Test for barrel.
 
static bool is_barrel (const unsigned int barrel_ec)
 
static int barrel_ec (const Identifier &id)
 Values of different levels (failure returns 0)
 
static int layer (const Identifier &id)
 
static int phi_module (const Identifier &id)
 
static int end (const Identifier &id)
 

Additional Inherited Members

- Protected Member Functions inherited from BesDetectorID
int mdc_field_value () const
 Provide efficient access to individual field values.
 
int cgem_field_value () const
 
int tof_field_value () const
 
int emc_field_value () const
 
int muc_field_value () const
 
int hlt_field_value () const
 
int mrpc_field_value () const
 
int get_detectorID (const Identifier &id) const
 
- Static Protected Attributes inherited from BesDetectorID
static const unsigned int MDC_ID = 0x10
 
static const unsigned int MDC_INDEX = 24
 
static const unsigned int MDC_MASK = 0xFF000000
 
static const unsigned int TOF_ID = 0x20
 
static const unsigned int TOF_INDEX = 24
 
static const unsigned int TOF_MASK = 0xFF000000
 
static const unsigned int EMC_ID = 0x30
 
static const unsigned int EMC_INDEX = 24
 
static const unsigned int EMC_MASK = 0xFF000000
 
static const unsigned int MUC_ID = 0x40
 
static const unsigned int MUC_INDEX = 24
 
static const unsigned int MUC_MASK = 0xFF000000
 
static const unsigned int HLT_ID = 0x50
 
static const unsigned int HLT_INDEX = 24
 
static const unsigned int HLT_MASK = 0xFF000000
 
static const unsigned int CGEM_ID = 0x60
 
static const unsigned int CGEM_INDEX = 24
 
static const unsigned int CGEM_MASK = 0xFF000000
 
static const unsigned int MRPC_ID = 0x70
 
static const unsigned int MRPC_INDEX = 24
 
static const unsigned int MRPC_MASK = 0xFF000000
 

Detailed Description

Definition at line 8 of file TofID.h.

Member Typedef Documentation

◆ size_type

Definition at line 11 of file TofID.h.

◆ value_type

Definition at line 12 of file TofID.h.

Constructor & Destructor Documentation

◆ TofID()

TofID::TofID ( void  )

constructor

Definition at line 6 of file TofID.cxx.

6 {
7}

◆ ~TofID()

TofID::~TofID ( void  )

destructor

Definition at line 9 of file TofID.cxx.

9 {
10}

Member Function Documentation

◆ barrel_ec()

int TofID::barrel_ec ( const Identifier id)
static

Values of different levels (failure returns 0)

Definition at line 95 of file TofID.cxx.

95 {
96
98 //std::cout << "TofID is_mrpc()? " << is_mrpc << std::endl;
99 //if(is_mrpc==true){ std::cout << "TofID barrel_ec(id) - mrpc true! -> return " << ((id.get_value() & TofID::PARTID_MASK) >> TofID::PARTID_INDEX) << std::endl;}
100 //else { std::cout << "TofID barrel_ec(id) - mrpc false! -> return " << ((id.get_value() & TofID::BARREL_EC_MASK) >> TofID::BARREL_EC_INDEX) << std::endl;}
101 if(is_mrpc==true){ return ((id.get_value() & TofID::PARTID_MASK) >> TofID::PARTID_INDEX); }
102 else { return ((id.get_value() & TofID::BARREL_EC_MASK) >> TofID::BARREL_EC_INDEX);}
103
104
105
106}
bool is_mrpc(const Identifier &id) const
static bool is_mymrpc(const Identifier &id)
Definition: TofID.cxx:58

Referenced by cell_id(), TofShower::energyCalib(), EsTimeAlg::execute(), EventAssemblyAlg::execute(), MrpcDBSRec::execute(), BesTrigL1::execute(), TofCheckDigi::FillCol(), TofShower::findShower(), getIntID(), TofShower::getMRPC_neighbours(), TofShower::getNeighbors(), is_barrel(), TofTrack::match(), PrintMcInfo::printDigi(), PrintMcInfo::printHit(), McTestAlg::RetrieveTof(), TofROOTGeo::SetHits(), TofData::setIdentify(), TofRawDataProvider::tofDataMapFull(), TofRawDataProvider::tofDataMapOnlineMode(), and values_ok().

◆ cell_id() [1/2]

Identifier TofID::cell_id ( int  barrel_ec,
int  layer,
int  phi_module,
int  end 
)
static

For a single crystal.

Definition at line 156 of file TofID.cxx.

160 {
161 assert ( values_ok(barrel_ec, layer, phi_module, end) );
162 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
163 (barrel_ec << BARREL_EC_INDEX)|
164 (layer << LAYER_INDEX) | (phi_module << PHI_INDEX) |
165 (end << END_INDEX);
166 return Identifier(value);
167}
static const unsigned int TOF_ID
Definition: BesDetectorID.h:70
static const unsigned int TOF_INDEX
Definition: BesDetectorID.h:71
static int end(const Identifier &id)
Definition: TofID.cxx:129
static int phi_module(const Identifier &id)
Definition: TofID.cxx:117
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:95
static bool values_ok(const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int)
Definition: TofID.cxx:13
static int layer(const Identifier &id)
Definition: TofID.cxx:109

Referenced by Adc::calculate(), RawDataTofMcHitCnv::createObj(), TofShower::getNeighbors(), BesRawDataWriter::SaveTofDigits(), and BesMcTruthWriter::SaveTofTruth().

◆ cell_id() [2/2]

Identifier TofID::cell_id ( int  value)
static

Definition at line 170 of file TofID.cxx.

171{
172 return Identifier(value);
173}

◆ cell_id_mrpc()

Identifier TofID::cell_id_mrpc ( int  partID,
int  scinNum 
)
static

Definition at line 177 of file TofID.cxx.

178{
179 assert( values_ok_mrpc(partID, scinNum));
180 unsigned int value = (BesDetectorID::MRPC_ID << MRPC_INDEX) |
181 //(3 << MRPC_INDEX) | //This two digits will be my identifier for a MRPC signal, MRPC_INDEX = 27
182 (partID << PARTID_INDEX) | // Which partID, PARTID_INDEX = 12
183 (scinNum);
184
185 //std::cout << "Matthias cell_id_mrpc " << value << std::endl;
186 return Identifier(value); //returns a secured 32bit variable (hex)
187}
static const unsigned int MRPC_ID
Definition: BesDetectorID.h:90
static const unsigned int MRPC_INDEX
Definition: BesDetectorID.h:91
static bool values_ok_mrpc(const unsigned int partID, const unsigned int scinNum)
Definition: TofID.cxx:39

Referenced by TofShower::getMRPC_neighbours(), and BesRawDataWriter::SaveTofDigits().

◆ cell_id_mrpc_mc()

Identifier TofID::cell_id_mrpc_mc ( int  partID,
int  scinNum 
)
static

Definition at line 189 of file TofID.cxx.

190{
191 assert( values_ok_mrpc_mc(partID, scinNum));
192 unsigned int value = (BesDetectorID::MRPC_ID << MRPC_INDEX) |
193 //(3 << MRPC_INDEX) | //This two digits will be my identifier for a MRPC signal, MRPC_INDEX = 27
194 (partID << PARTID_INDEX) | // Which partID, PARTID_INDEX = 12
195 (scinNum);
196 return Identifier(value); //returns a secured 32bit variable (hex)
197}
static bool values_ok_mrpc_mc(const unsigned int partID, const unsigned int scinNum)
Definition: TofID.cxx:49

Referenced by RawDataTofMcHitCnv::createObj(), and BesMcTruthWriter::SaveTofTruth().

◆ end()

int TofID::end ( const Identifier id)
static

Definition at line 129 of file TofID.cxx.

129 {
130 bool is_mrpc=TofID::is_mymrpc(id);
131 if( is_mrpc==true){return 0;}
132 else { return ((id.get_value() & TofID::END_MASK) >> TofID::END_INDEX);}
133}

Referenced by cell_id(), TofShower::energyCalib(), TofCheckDigi::FillCol(), getIntID(), TofShower::getNeighbors(), TofTrack::match(), McTestAlg::RetrieveTof(), TofROOTGeo::SetHits(), TofRawDataProvider::tofDataMapFull(), and TofRawDataProvider::tofDataMapOnlineMode().

◆ getBARREL_EC_MAX()

unsigned int TofID::getBARREL_EC_MAX ( )
static

Definition at line 246 of file TofID.cxx.

247{
248 return BARREL_EC_MAX;
249}

Referenced by TofBuilder::initialize().

◆ getBARREL_EC_MIN()

unsigned int TofID::getBARREL_EC_MIN ( )
static

Definition at line 251 of file TofID.cxx.

252{
253 return BARREL_EC_MIN;
254}

Referenced by TofBuilder::initialize().

◆ getIntID()

unsigned int TofID::getIntID ( int  barrel_ec,
int  layer,
int  phi_module,
int  end 
)
static

Definition at line 200 of file TofID.cxx.

205{
206 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
207 (barrel_ec << BARREL_EC_INDEX)|
208 (layer << LAYER_INDEX) | (phi_module << PHI_INDEX) |
209 (end << END_INDEX);
210 return value;
211}

Referenced by TofBuilder::initialize(), TofTrack::setTofData(), MrpcTrack::setTofData(), MrpcDBSTrack::setTofData(), and TofRawDataProvider::tofDataMapFull().

◆ getIntID_mrpc()

unsigned int TofID::getIntID_mrpc ( int  partID,
int  scinNum 
)
static

Definition at line 216 of file TofID.cxx.

217{
218 unsigned int value = ((BesDetectorID::MRPC_ID << MRPC_INDEX) |
219 //(3 << MRPC_INDEX) | //This two digits will be my identifier for a MRPC signal, MRPC_INDEX = 27
220 (partID << PARTID_INDEX) | // Which partID, PARTID_INDEX = 12
221 (scinNum));
222 return value;
223}

Referenced by MrpcTrack::setTofData(), and MrpcDBSTrack::setTofData().

◆ getLAYER_BARREL_MAX()

unsigned int TofID::getLAYER_BARREL_MAX ( )
static

Definition at line 227 of file TofID.cxx.

228{
229 return LAYER_BARREL_MAX;
230}

Referenced by TofBuilder::initialize().

◆ getLAYER_ENDCAP_MAX()

unsigned int TofID::getLAYER_ENDCAP_MAX ( )
static

Definition at line 232 of file TofID.cxx.

233{
234 return LAYER_ENDCAP_MAX;
235}

Referenced by TofBuilder::initialize().

◆ getPHI_BARREL_MAX()

unsigned int TofID::getPHI_BARREL_MAX ( )
static

Definition at line 237 of file TofID.cxx.

238{
239 return PHI_BARREL_MAX;
240}

Referenced by RawDataTofMcHitCnv::createObj(), TofBuilder::initialize(), BesRawDataWriter::SaveTofDigits(), and BesMcTruthWriter::SaveTofTruth().

◆ getPHI_ENDCAP_MAX()

unsigned int TofID::getPHI_ENDCAP_MAX ( )
static

Definition at line 242 of file TofID.cxx.

243{
244 return PHI_ENDCAP_MAX;
245}

◆ is_barrel() [1/2]

bool TofID::is_barrel ( const Identifier id)
static

Test for barrel.

Definition at line 78 of file TofID.cxx.

78 {
79
81
82 if(is_mrpc==true){return false;}
83 else
84 {
85 unsigned int pos = (id.get_value() & TofID::BARREL_EC_MASK) >> TofID::BARREL_EC_INDEX;
86 return (pos == BARREL_EC_MAX || pos == BARREL_EC_MIN) ? false : true;
87 }
88}

Referenced by EmcRecTofDigitCalib::Convert(), RawDataTofMcHitCnv::createObj(), layer_max(), phi_module_max(), BesRawDataWriter::SaveTofDigits(), and BesMcTruthWriter::SaveTofTruth().

◆ is_barrel() [2/2]

bool TofID::is_barrel ( const unsigned int  barrel_ec)
static

Definition at line 91 of file TofID.cxx.

91 {
92 return (barrel_ec == BARRELCODE) ? true : false;
93}

◆ is_mymrpc()

bool TofID::is_mymrpc ( const Identifier id)
static

Definition at line 58 of file TofID.cxx.

59{
60 //if( (id & TofID::MRPC_MASK)== MRPC_MASK){ return true;}
62 {
63 //std::cout << "MATTHIAS my mrpc is true " <<std::endl;
64 //std::cout << " (id & (BesDetectorID::MRPC_ID << MRPC_INDEX)) "<< (id & (BesDetectorID::MRPC_ID << MRPC_INDEX) ) <<std::endl;
65 //std::cout << " (BesDetectorID::MRPC_ID << MRPC_INDEX) " << (BesDetectorID::MRPC_ID << MRPC_INDEX)<<std::endl;
66 return true;
67 }
68 else
69 {
70 //std::cout << "MATTHIAS my mrpc is false " <<std::endl;
71 return false;
72 }
73}

Referenced by barrel_ec(), Adc::calculate(), end(), TofShower::energyCalib(), EsTimeAlg::execute(), EventAssemblyAlg::execute(), TofShower::findSeed(), TofShower::findShower(), is_barrel(), layer(), and phi_module().

◆ layer()

◆ layer_max()

int TofID::layer_max ( const Identifier id)

Definition at line 138 of file TofID.cxx.

138 {
139 if (is_barrel(id)) {
140 return LAYER_BARREL_MAX;
141 } else {
142 return LAYER_ENDCAP_MAX;
143 }
144}
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: TofID.cxx:78

◆ phi_module()

int TofID::phi_module ( const Identifier id)
static

Definition at line 117 of file TofID.cxx.

117 {
118
119 bool is_mrpc=TofID::is_mymrpc(id);
120 //std::cout << "TofID Identifier: " << id << std::endl;
121 //std::cout << "TofID is_mrpc()? " << is_mrpc << std::endl;
122 //if(is_mrpc==true){ std::cout << "TofID phimodule(id) - mrpc true! -> return " << ((id.get_value() & TofID::SCINNUM_MASK)) << std::endl;}
123 //else { std::cout << "TofID phimodule(id) - mrpc false! -> return " << ((id.get_value() & TofID::PHI_MASK) >> TofID::PHI_INDEX) << std::endl;}
124 if(is_mrpc==true){return ((id.get_value() & TofID::SCINNUM_MASK));}
125 else {return ((id.get_value() & TofID::PHI_MASK) >> TofID::PHI_INDEX); }
126}

Referenced by cell_id(), EmcRecTofDigitCalib::Convert(), TofShower::energyCalib(), EsTimeAlg::execute(), EventAssemblyAlg::execute(), MrpcDBSRec::execute(), TofEnergyCalib::execute(), BesTrigL1::execute(), TofCheckDigi::FillCol(), TofShower::findShower(), getIntID(), TofShower::getMRPC_neighbours(), TofShower::getNeighbors(), RecEmcTofHit::IntCellId(), TofTrack::match(), PrintMcInfo::printDigi(), PrintMcInfo::printHit(), McTestAlg::RetrieveTof(), TofROOTGeo::SetHits(), TofData::setIdentify(), TofRawDataProvider::tofDataMapFull(), and TofRawDataProvider::tofDataMapOnlineMode().

◆ phi_module_max()

int TofID::phi_module_max ( const Identifier id)

Max/Min values for each field (error returns -999)

Definition at line 147 of file TofID.cxx.

147 {
148 if (is_barrel(id)) {
149 return PHI_BARREL_MAX;
150 } else {
151 return PHI_ENDCAP_MAX;
152 }
153}

◆ values_ok()

bool TofID::values_ok ( const unsigned int  barrel_ec,
const unsigned int  layer,
const unsigned int  phi_module,
const unsigned int   
)
static

Definition at line 13 of file TofID.cxx.

17 {
18 // Check values
19
20 // std::cout << " barrel_ec = "<< barrel_ec
21 // << " layer = "<< layer
22 // << " phi_module = "<< phi_module <<std::endl;
23
24 if ( barrel_ec > BARREL_EC_MAX) return false;
25 if ( BARREL_EC_MIN == barrel_ec || BARREL_EC_MIN == barrel_ec) {
26 // if ( phi_module > PHI_ENDCAP_MAX ) return false;
27 if ( layer > LAYER_ENDCAP_MAX ) return false;
28 }
29 else {
30 //if ( phi_module > PHI_BARREL_MAX ) return false; //#Matthias : Switched of as the simulation will not run if switched on!
31 if ( layer > LAYER_BARREL_MAX ) return false;
32 }
33
34 return true;
35}

Referenced by cell_id().

◆ values_ok_mrpc()

bool TofID::values_ok_mrpc ( const unsigned int  partID,
const unsigned int  scinNum 
)
static

Definition at line 39 of file TofID.cxx.

40{
41 if(partID<3 || partID>6) return false;
42 if(scinNum<26 || scinNum>474) return false;
43 if(scinNum%25==0) return false;
44
45 return true;
46}

Referenced by cell_id_mrpc().

◆ values_ok_mrpc_mc()

bool TofID::values_ok_mrpc_mc ( const unsigned int  partID,
const unsigned int  scinNum 
)
static

Definition at line 49 of file TofID.cxx.

50{
51 if(partID<3 || partID>6) return false;
52 if(scinNum<25 || scinNum>474) return false;
53
54 return true;
55}

Referenced by cell_id_mrpc_mc().


The documentation for this class was generated from the following files: