15 using namespace sistrip;
30 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
31 <<
" Constructing object...";
45 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
46 <<
" Terse print out of FED cabling:" << std::endl;
50 std::stringstream sss;
51 sss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
52 <<
" Summary of FED cabling:" << std::endl;
70 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
71 <<
" Constructing object..." << endl;
79 <<
"[" << __PRETTY_FUNCTION__ <<
"]"
80 <<
" Destructing object...";
98 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
99 <<
" NULL pointer to SiStripConfigDb interface!"
100 <<
" Aborting upload...";
107 for ( ; ip != jp; ++ip ) {
110 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
111 <<
" Starting from partition " << ip->first
112 <<
" with versions:\n" << std::dec
113 <<
" Conn: " << ip->second.cabVersion().first <<
"." << ip->second.cabVersion().second <<
"\n"
114 <<
" FED: " << ip->second.fedVersion().first <<
"." << ip->second.fedVersion().second <<
"\n"
115 <<
" FEC: " << ip->second.fecVersion().first <<
"." << ip->second.fecVersion().second <<
"\n"
116 <<
" Mask: " << ip->second.maskVersion().first <<
"." << ip->second.maskVersion().second;
123 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
124 <<
" Created analysis descriptions for "
125 << anals.size() <<
" devices";
131 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
132 <<
" Uploading major version of analysis descriptions to DB"
133 <<
" (will be used for physics)...";
137 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
138 <<
" Uploading minor version of analysis descriptions to DB"
139 <<
" (will not be used for physics)...";
145 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
146 <<
" Upload of analysis descriptions to DB finished!";
150 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
151 <<
" TEST! No analysis descriptions will be uploaded to DB...";
157 for ( ; ip != jp; ++ip ) {
159 tkStateVector states = df->getCurrentStates();
160 tkStateVector::const_iterator istate = states.begin();
161 tkStateVector::const_iterator jstate = states.end();
162 while ( istate != jstate ) {
163 if ( *istate && ip->first == (*istate)->getPartitionName() ) {
break; }
167 if ( istate != states.end() ) {
169 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
170 <<
" Created new version for partition " << ip->first
171 <<
". Current state:\n" << std::dec
172 <<
" Conn: " << (*istate)->getConnectionVersionMajorId() <<
"." << (*istate)->getConnectionVersionMinorId() <<
"\n"
173 <<
" FED: " << (*istate)->getFedVersionMajorId() <<
"." << (*istate)->getFedVersionMinorId() <<
"\n"
174 <<
" FEC: " << (*istate)->getFecVersionMajorId() <<
"." << (*istate)->getFecVersionMinorId() <<
"\n"
175 <<
" Mask: " << (*istate)->getMaskVersionMajorId() <<
"." << (*istate)->getMaskVersionMinorId();
190 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
191 <<
" NULL pointer to SiStripFedCabling object!";
195 Analyses::iterator ianal =
data().begin();
196 Analyses::iterator janal =
data().end();
197 for ( ; ianal != janal; ++ianal ) {
203 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
204 <<
" NULL pointer to CommissioningAnalysis object!";
225 if ( fed_key.
path() != fed.
path() ) {
227 std::stringstream ss;
228 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
229 <<
" Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
230 <<
" Incompatible FED key retrieved from cabling!" << std::endl
231 <<
" FED key from analysis object : " << fed_key.
path() << std::endl
232 <<
" FED key from cabling object : " << fed.
path() << std::endl
233 <<
" FED id/ch from analysis object: " << fed_key.
fedId() <<
"/" << fed_key.
fedChannel() << std::endl
234 <<
" FED id/ch from cabling object : " << conn.
fedId() <<
"/" << conn.
fedCh();
237 }
else if ( fec_key.
path() != fec.path() ) {
239 std::stringstream ss;
240 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
241 <<
" Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
242 <<
" Incompatible FEC key retrieved from cabling!" << std::endl
243 <<
" FEC key from analysis object : " << fec_key.
path() << std::endl
244 <<
" FEC key from cabling object : " << fec.path();
263 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
264 <<
" Creating AnalysisDescriptions...";
273 Analyses::iterator ianal =
data().begin();
274 Analyses::iterator janal =
data().end();
275 for ( ; ianal != janal; ++ianal ) {
305 <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
306 <<
" NULL pointer to SiStripConfigDb interface!";
312 for ( ; ii !=
jj; ++
ii ) {
320 SiStripConfigDb::DeviceDescriptionsV::const_iterator idcu = dcus.begin();
321 SiStripConfigDb::DeviceDescriptionsV::const_iterator jdcu = dcus.end();
322 for ( ; idcu != jdcu; ++idcu ) {
325 dcuDescription* dcu =
dynamic_cast<dcuDescription*
>( *idcu );
326 if ( !dcu ) {
continue; }
327 if ( dcu->getDcuType() !=
"FEH" ) {
continue; }
332 if ( dcu->getDcuHardId() == 16448250 )
continue;
335 SiStripConfigDb::DcuDetIdsV::const_iterator idet = dets.end();
337 if ( idet == dets.begin() ) {
continue; }
340 TkDcuInfo* det = idet->second;
341 if ( !det ) {
continue; }
353 info.
dcuId_ = det->getDcuHardId();
354 info.
detId_ = det->getDetId();
355 info.
pairs_ = det->getApvNumber()/2;
365 std::stringstream ss;
366 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
367 <<
" List of modules for "
369 <<
" partitions, with their DCUids, DetIds, and nApvPairs: " << std::endl;
370 std::map<std::string,DetInfos>::const_iterator ii =
detInfo_.begin();
371 std::map<std::string,DetInfos>::const_iterator jj =
detInfo_.end();
372 for ( ; ii !=
jj; ++
ii ) {
373 ss <<
" Partition \"" << ii->first
374 <<
"\" has " << ii->second.size()
377 DetInfos::const_iterator iii = ii->second.begin();
378 DetInfos::const_iterator jjj = ii->second.end();
379 for ( ; iii != jjj; ++iii ) {
389 << std::setw(8) << std::setfill(
'0') << iii->second.dcuId_
391 << std::setw(8) << std::setfill(
'0') << iii->second.detId_
394 << iii->second.pairs_
408 std::map<std::string,DetInfos>::const_iterator
ii =
detInfo_.begin();
409 std::map<std::string,DetInfos>::const_iterator
jj =
detInfo_.end();
410 for ( ; ii !=
jj; ++
ii ) {
411 DetInfos::const_iterator iii = ii->second.find( tmp.
key() );
412 if ( iii != ii->second.end() ) {
return std::make_pair(ii->first,iii->second); }
414 return std::make_pair(
"",
DetInfo());
421 std::pair<std::string,DetInfo>
info =
detInfo(key);
423 if ( key.
channel() == 2 && info.second.pairs_ == 2 ) {
return false; }
424 else {
return true; }
426 std::stringstream ss;
427 ss <<
"[CommissioningHistosUsingDb::" << __func__ <<
"]"
428 <<
" 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
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 FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
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
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.
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
DcuDetIdsRange getDcuDetIds(std::string partition="")
virtual void uploadConfigurations()
virtual ~CommissioningHistosUsingDb()
static void buildFecCablingFromDevices(SiStripConfigDb *const, SiStripFecCabling &)