14 using namespace sistrip;
29 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
30 <<
" Constructing object...";
44 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
45 <<
" Terse print out of FED cabling:" << std::endl;
49 std::stringstream sss;
50 sss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
51 <<
" Summary of FED cabling:" << std::endl;
69 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
70 <<
" Constructing object..." << endl;
78 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
79 <<
" Destructing object...";
97 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
98 <<
" NULL pointer to SiStripConfigDb interface!"
99 <<
" Aborting upload...";
106 for ( ; ip != jp; ++ip ) {
109 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
110 <<
" Starting from partition " << ip->first
112 <<
" Conn: " << ip->second.cabVersion().first <<
"." << ip->second.cabVersion().second <<
"\n"
113 <<
" FED: " << ip->second.fedVersion().first <<
"." << ip->second.fedVersion().second <<
"\n"
114 <<
" FEC: " << ip->second.fecVersion().first <<
"." << ip->second.fecVersion().second <<
"\n"
115 <<
" Mask: " << ip->second.maskVersion().first <<
"." << ip->second.maskVersion().second;
122 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
123 <<
" Created analysis descriptions for "
124 << anals.size() <<
" devices";
130 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
131 <<
" Uploading major version of analysis descriptions to DB"
132 <<
" (will be used for physics)...";
136 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
137 <<
" Uploading minor version of analysis descriptions to DB"
138 <<
" (will not be used for physics)...";
144 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
145 <<
" Upload of analysis descriptions to DB finished!";
149 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
150 <<
" TEST! No analysis descriptions will be uploaded to DB...";
156 for ( ; ip != jp; ++ip ) {
158 tkStateVector states = df->getCurrentStates();
159 tkStateVector::const_iterator istate = states.begin();
160 tkStateVector::const_iterator jstate = states.end();
161 while ( istate != jstate ) {
162 if ( *istate && ip->first == (*istate)->getPartitionName() ) {
break; }
166 if ( istate != states.end() ) {
168 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
169 <<
" Created new version for partition " << ip->first
171 <<
" Conn: " << (*istate)->getConnectionVersionMajorId() <<
"." << (*istate)->getConnectionVersionMinorId() <<
"\n"
172 <<
" FED: " << (*istate)->getFedVersionMajorId() <<
"." << (*istate)->getFedVersionMinorId() <<
"\n"
173 <<
" FEC: " << (*istate)->getFecVersionMajorId() <<
"." << (*istate)->getFecVersionMinorId() <<
"\n"
174 <<
" Mask: " << (*istate)->getMaskVersionMajorId() <<
"." << (*istate)->getMaskVersionMinorId();
189 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
190 <<
" NULL pointer to SiStripFedCabling object!";
194 Analyses::iterator ianal =
data().begin();
195 Analyses::iterator janal =
data().end();
196 for ( ; ianal != janal; ++ianal ) {
202 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
203 <<
" NULL pointer to CommissioningAnalysis object!";
224 if ( fed_key.
path() != fed.
path() ) {
226 std::stringstream
ss;
227 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
228 <<
" Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
229 <<
" Incompatible FED key retrieved from cabling!" << std::endl
230 <<
" FED key from analysis object : " << fed_key.
path() << std::endl
231 <<
" FED key from cabling object : " << fed.
path() << std::endl
232 <<
" FED id/ch from analysis object: " << fed_key.
fedId() <<
"/" << fed_key.
fedChannel() << std::endl
233 <<
" FED id/ch from cabling object : " << conn.
fedId() <<
"/" << conn.
fedCh();
236 }
else if ( fec_key.
path() != fec.path() ) {
238 std::stringstream
ss;
239 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
240 <<
" Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
241 <<
" Incompatible FEC key retrieved from cabling!" << std::endl
242 <<
" FEC key from analysis object : " << fec_key.
path() << std::endl
243 <<
" FEC key from cabling object : " << fec.path();
262 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
263 <<
" Creating AnalysisDescriptions...";
272 Analyses::iterator ianal =
data().begin();
273 Analyses::iterator janal =
data().end();
274 for ( ; ianal != janal; ++ianal ) {
304 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
305 <<
" NULL pointer to SiStripConfigDb interface!";
311 for ( ; ii !=
jj; ++
ii ) {
319 SiStripConfigDb::DeviceDescriptionsV::const_iterator idcu = dcus.begin();
320 SiStripConfigDb::DeviceDescriptionsV::const_iterator jdcu = dcus.end();
321 for ( ; idcu != jdcu; ++idcu ) {
324 dcuDescription* dcu =
dynamic_cast<dcuDescription*
>( *idcu );
325 if ( !dcu ) {
continue; }
326 if ( dcu->getDcuType() !=
"FEH" ) {
continue; }
331 if ( dcu->getDcuHardId() == 16448250 )
continue;
334 SiStripConfigDb::DcuDetIdsV::const_iterator idet = dets.end();
336 if ( idet == dets.begin() ) {
continue; }
339 TkDcuInfo* det = idet->second;
340 if ( !det ) {
continue; }
352 info.
dcuId_ = det->getDcuHardId();
353 info.
detId_ = det->getDetId();
354 info.
pairs_ = det->getApvNumber()/2;
364 std::stringstream
ss;
365 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
366 <<
" List of modules for "
368 <<
" partitions, with their DCUids, DetIds, and nApvPairs: " << std::endl;
369 std::map<std::string,DetInfos>::const_iterator ii =
detInfo_.begin();
370 std::map<std::string,DetInfos>::const_iterator jj =
detInfo_.end();
371 for ( ; ii !=
jj; ++
ii ) {
372 ss <<
" Partition \"" << ii->first
373 <<
"\" has " << ii->second.size()
376 DetInfos::const_iterator iii = ii->second.begin();
377 DetInfos::const_iterator jjj = ii->second.end();
378 for ( ; iii != jjj; ++iii ) {
388 << std::setw(8) << std::setfill(
'0') << iii->second.dcuId_
390 << std::setw(8) << std::setfill(
'0') << iii->second.detId_
393 << iii->second.pairs_
407 std::map<std::string,DetInfos>::const_iterator
ii =
detInfo_.begin();
408 std::map<std::string,DetInfos>::const_iterator
jj =
detInfo_.end();
409 for ( ; ii !=
jj; ++
ii ) {
410 DetInfos::const_iterator iii = ii->second.find( tmp.
key() );
411 if ( iii != ii->second.end() ) {
return std::make_pair(ii->first,iii->second); }
413 return std::make_pair(
"",
DetInfo());
420 std::pair<std::string,DetInfo>
info =
detInfo(key);
422 if ( key.
channel() == 2 && info.second.pairs_ == 2 ) {
return false; }
423 else {
return true; }
425 std::stringstream
ss;
426 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
427 <<
" Cannot find module (crate/FEC/ring/CCU/module): "
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
DcuDetIds::range DcuDetIdsRange
const uint32_t & fedKey() const
const uint16_t & fecRing() const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
A container class for generic run and event-related info, information required by the commissioning a...
const uint16_t & fedCh() const
bool deviceIsPresent(const SiStripFecKey &)
DeviceFactory *const deviceFactory(std::string method_name="") const
virtual void addDcuDetIds()
static const uint32_t invalid32_
void uploadAnalysisDescriptions(bool calibration_for_physics=false, std::string partition="")
void terse(std::stringstream &) const
void addAnalysisDescriptions(std::string partition, AnalysisDescriptionsV &)
static const char mlDqmClient_[]
const uint16_t & fecSlot() const
uint16_t lldChannel() const
const uint16_t & fedId() const
std::map< std::string, DetInfos > detInfo_
const uint32_t & key() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
const_iterator_range partitions() const
static DcuDetIdsV::const_iterator findDcuDetId(DcuDetIdsV::const_iterator begin, DcuDetIdsV::const_iterator end, uint32_t dcu_id)
const uint16_t & fecRing() const
const uint32_t & detId() const
static void buildFecCabling(SiStripConfigDb *const, SiStripFecCabling &, const sistrip::CablingSource &)
Class containning control, module, detector and connection information, at the level of a FED channel...
DeviceDescriptions::range DeviceDescriptionsRange
const uint32_t & dcuId() const
void clearAnalysisDescriptions(std::string partition="")
An interface class to the DeviceFactory.
const uint16_t & ccuChan() const
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
const uint32_t & fecKey() const
const std::string & path() const
DeviceAddress deviceAddress(const deviceDescription &)
uint16_t fedChannel() const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const uint16_t & ccuAddr() const
const uint32_t & dcuId() const
const uint16_t & fecCrate() const
SiStripFedCabling * cabling_
static void getFedCabling(const SiStripFecCabling &in, SiStripFedCabling &out)
std::pair< std::string, DetInfo > detInfo(const SiStripFecKey &)
const uint16_t & feUnit() const
const SiStripDbParams & dbParams() const
const uint16_t & channel() const
virtual void create(SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
sistrip::RunType runType_
virtual void createAnalyses(SiStripConfigDb::AnalysisDescriptionsV &)
const uint16_t & ccuAddr() const
CommissioningHistosUsingDb()
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
std::vector< std::vector< double > > tmp
std::vector< AnalysisDescription * > AnalysisDescriptionsV
const uint16_t & feChan() const
const uint32_t & detId() const
const uint16_t & ccuChan() const
const uint16_t & fedId() const
SiStripConfigDb *const db() const
Abstract base for derived classes that provide analysis of commissioning histograms.
volatile std::atomic< bool > shutdown_flag false
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
DcuDetIdsRange getDcuDetIds(std::string partition="")
virtual void uploadConfigurations()
virtual ~CommissioningHistosUsingDb()
static void buildFecCablingFromDevices(SiStripConfigDb *const, SiStripFecCabling &)