CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
SiStripCondObjBuilderFromDb Class Reference

#include <SiStripCondObjBuilderFromDb.h>

Public Types

typedef std::vector
< pair_apvpairconn >::iterator 
i_apvpairconn
 
typedef std::vector
< pair_detcon >::iterator 
i_trackercon
 
typedef std::pair< uint32_t,
FedChannelConnection
pair_apvpairconn
 
typedef std::pair< uint32_t,
v_apvpairconn
pair_detcon
 
typedef std::vector< pair_detcontrackercon
 
typedef std::vector
< pair_apvpairconn
v_apvpairconn
 

Public Member Functions

void buildAnalysisRelatedObjects (SiStripConfigDb *const db, const trackercon &tc)
 
void buildCondObj ()
 
void buildFECRelatedObjects (SiStripConfigDb *const db, const trackercon &tc)
 
void buildFEDRelatedObjects (SiStripConfigDb *const db, const trackercon &tc)
 
void buildStripRelatedObjects (SiStripConfigDb *const db, const SiStripDetCabling &det_cabling)
 
TrackerTopologybuildTrackerTopology ()
 
bool checkForCompatibility (std::stringstream &input, std::stringstream &output, std::string &label)
 
const SiStripDbParamsdbParams () const
 
SiStripApvGaingetApvGain ()
 
SiStripLatencygetApvLatency ()
 
std::string getConfigString (const std::type_info &typeInfo)
 
SiStripFedCablinggetFedCabling ()
 
SiStripNoisesgetNoises ()
 
SiStripPedestalsgetPedestals ()
 
SiStripQualitygetQuality ()
 
SiStripThresholdgetThreshold ()
 
void getValue (SiStripFedCabling *&val)
 
void getValue (SiStripPedestals *&val)
 
void getValue (SiStripNoises *&val)
 
void getValue (SiStripThreshold *&val)
 
void getValue (SiStripQuality *&val)
 
void getValue (SiStripBadStrip *&val)
 
void getValue (SiStripApvGain *&val)
 
void getValue (SiStripLatency *&val)
 
 SiStripCondObjBuilderFromDb ()
 
 SiStripCondObjBuilderFromDb (const edm::ParameterSet &, const edm::ActivityRegistry &)
 
virtual ~SiStripCondObjBuilderFromDb ()
 

Protected Member Functions

vector< const
FedChannelConnection * > 
buildConnections (const SiStripDetCabling &det_cabling, uint32_t det_id)
 
void checkUpdate ()
 
vector< uint32_t > retrieveActiveDetIds (const SiStripDetCabling &det_cabling)
 
bool retrieveFedDescriptions (SiStripConfigDb *const db)
 
uint16_t retrieveNumberAPVPairs (uint32_t det_id)
 
bool retrieveTimingAnalysisDescriptions (SiStripConfigDb *const db)
 
void setDefaultValuesApvLatency (SiStripLatency &latency_, const FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr)
 
void setDefaultValuesApvTiming ()
 
void setDefaultValuesCabling (uint16_t apvPair)
 
bool setValuesApvLatency (SiStripLatency &latency_, SiStripConfigDb *const db, FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr, SiStripConfigDb::DeviceDescriptionsRange apvs)
 
bool setValuesApvTiming (SiStripConfigDb *const db, FedChannelConnection &ipair)
 
bool setValuesCabling (SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid)
 
void storeNoise (uint32_t det_id)
 
void storePedestals (uint32_t det_id)
 
void storeQuality (uint32_t det_id)
 
void storeThreshold (uint32_t det_id)
 
void storeTiming (uint32_t det_id)
 

Protected Attributes

edm::Service< SiStripConfigDbdb_
 
SiStripDbParams dbParams_
 
SiStripFedCablingfed_cabling_
 
SiStripApvGaingain_
 
SiStripApvGain::InputVector inputApvGain
 
SiStripNoises::InputVector inputNoises
 
SiStripPedestals::InputVector inputPedestals
 
SiStripQuality::InputVector inputQuality
 
SiStripThreshold::InputVector inputThreshold
 
SiStripLatencylatency_
 
bool m_debug
 
uint16_t m_defaultapvlatencyvalue
 
uint16_t m_defaultapvmodevalue
 
float m_defaultnoisevalue
 
float m_defaultpedestalvalue
 
float m_defaultthresholdhighvalue
 
float m_defaultthresholdlowvalue
 
float m_defaulttickheightvalue
 
float m_gaincalibrationfactor
 
bool m_useanalysis
 
bool m_usefec
 
bool m_usefed
 
SiStripNoisesnoises_
 
pair_apvpairconn p_apvpcon
 
pair_detcon p_detcon
 
SiStripPedestalspedestals_
 
SiStripQualityquality_
 
SiStripThresholdthreshold_
 
TrackerTopologytTopo
 
v_apvpairconn v_apvpcon
 
trackercon v_trackercon
 

Detailed Description

Definition at line 45 of file SiStripCondObjBuilderFromDb.h.

Member Typedef Documentation

Definition at line 56 of file SiStripCondObjBuilderFromDb.h.

Definition at line 55 of file SiStripCondObjBuilderFromDb.h.

Definition at line 50 of file SiStripCondObjBuilderFromDb.h.

Definition at line 52 of file SiStripCondObjBuilderFromDb.h.

Definition at line 53 of file SiStripCondObjBuilderFromDb.h.

Definition at line 51 of file SiStripCondObjBuilderFromDb.h.

Constructor & Destructor Documentation

SiStripCondObjBuilderFromDb::SiStripCondObjBuilderFromDb ( )

Definition at line 55 of file SiStripCondObjBuilderFromDb.cc.

References LogTrace, and sistrip::mlESSources_.

56 {
58  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
59  << " Constructing object...";
60 }
#define LogTrace(id)
static const char mlESSources_[]
SiStripCondObjBuilderFromDb::SiStripCondObjBuilderFromDb ( const edm::ParameterSet pset,
const edm::ActivityRegistry  
)

Definition at line 32 of file SiStripCondObjBuilderFromDb.cc.

References LogTrace, and sistrip::mlESSources_.

33  :
34  m_gaincalibrationfactor(static_cast<float>(pset.getUntrackedParameter<double>("GainNormalizationFactor",690.))),
35  m_defaultpedestalvalue(static_cast<float>(pset.getUntrackedParameter<double>("DefaultPedestal",0.))),
36  m_defaultnoisevalue(static_cast<float>(pset.getUntrackedParameter<double>("DefaultNoise",0.))),
37  m_defaultthresholdhighvalue(static_cast<float>(pset.getUntrackedParameter<double>("DefaultThresholdHigh",0.))),
38  m_defaultthresholdlowvalue(static_cast<float>(pset.getUntrackedParameter<double>("DefaultThresholdLow",0.))),
39  m_defaultapvmodevalue(static_cast<uint16_t>(pset.getUntrackedParameter<uint32_t>("DefaultAPVMode",37))),
40  m_defaultapvlatencyvalue(static_cast<uint16_t>(pset.getUntrackedParameter<uint32_t>("DefaultAPVLatency",142))),
41  m_defaulttickheightvalue(static_cast<float>(pset.getUntrackedParameter<double>("DefaultTickHeight",690.))),
42  m_useanalysis(static_cast<bool>(pset.getUntrackedParameter<bool>("UseAnalysis",false))),
43  m_usefed(static_cast<bool>(pset.getUntrackedParameter<bool>("UseFED",false))),
44  m_usefec(static_cast<bool>(pset.getUntrackedParameter<bool>("UseFEC",false))),
45  m_debug(static_cast<bool>(pset.getUntrackedParameter<bool>("DebugMode",false))),
47 {
49  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
50  << " Constructing object...";
51 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
static const char mlESSources_[]
SiStripCondObjBuilderFromDb::~SiStripCondObjBuilderFromDb ( )
virtual

Definition at line 64 of file SiStripCondObjBuilderFromDb.cc.

References LogTrace, sistrip::mlESSources_, and tTopo.

64  {
66  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
67  << " Destructing object...";
68  delete tTopo;
69 }
#define LogTrace(id)
static const char mlESSources_[]

Member Function Documentation

void SiStripCondObjBuilderFromDb::buildAnalysisRelatedObjects ( SiStripConfigDb *const  db,
const trackercon tc 
)

Definition at line 668 of file SiStripCondObjBuilderFromDb.cc.

References shell::connections, gather_cfg::cout, db_, end, gain_, m_defaulttickheightvalue, m_gaincalibrationfactor, sistrip::mlESSources_, retrieveTimingAnalysisDescriptions(), setDefaultValuesApvTiming(), setValuesApvTiming(), and storeTiming().

Referenced by buildCondObj().

668  {
669  trackercon tc = _tc;
670  std::cout << "Entering [SiStripCondObjBuilderFromDb::"<<__func__ <<"]"<<std::endl;
671  //data container
672  gain_= new SiStripApvGain();
673 
674  //check if Timing analysis description is found, otherwise quit
677  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
678  << " NULL pointer to AnalysisDescriptions returned by SiStripConfigDb!"
679  << " Cannot build Analysis object! QUIT";
680  // some values have to be set, otherwise PopCon will crash
682  storeTiming(4711);
683  return;
684  }
685 
686  i_trackercon detids_end=tc.end();
687 
688  //loop detids
689  for(i_trackercon detids=tc.begin();detids!=detids_end;detids++){
690  uint32_t detid = (*detids).first;
691  i_apvpairconn connections_end=((*detids).second).end();
692 
693  //loop connections
694  for(i_apvpairconn connections=((*detids).second).begin();connections!=connections_end;connections++){
695  uint32_t apvPair =(*connections).first;
696  FedChannelConnection ipair =(*connections).second;
697 
698 
699  //no connection for apvPair found
700  if(apvPair>=100){
702  continue;
703  }
704 
705  //fill data
706  if(!setValuesApvTiming(db, ipair)){
707  std::cout
708  << "\n "
709  << " Unable to find Timing Analysis Description"
710  << " Writing default values for DetId: " << detid
711  << " Value: " << m_defaulttickheightvalue/m_gaincalibrationfactor << std::endl;
713  }
714  }//connections
715  storeTiming(detid);
716  }//detids
717 
718 }
edm::Service< SiStripConfigDb > db_
list connections
Definition: shell.py:10
Class containning control, module, detector and connection information, at the level of a FED channel...
std::vector< pair_detcon > trackercon
#define end
Definition: vmac.h:37
bool retrieveTimingAnalysisDescriptions(SiStripConfigDb *const db)
tuple cout
Definition: gather_cfg.py:145
static const char mlESSources_[]
std::vector< pair_detcon >::iterator i_trackercon
std::vector< pair_apvpairconn >::iterator i_apvpairconn
bool setValuesApvTiming(SiStripConfigDb *const db, FedChannelConnection &ipair)
void SiStripCondObjBuilderFromDb::buildCondObj ( )

Builds pedestals using FED descriptions and cabling info retrieved from configuration database.

Definition at line 226 of file SiStripCondObjBuilderFromDb.cc.

References buildAnalysisRelatedObjects(), SiStripFedCablingBuilderFromDb::buildFecCabling(), buildFECRelatedObjects(), buildFEDRelatedObjects(), buildStripRelatedObjects(), sistrip::CABLING_FROM_CONNS, SiStripConfigDb::databaseCache(), db_, SiStripConfigDb::deviceFactory(), fed_cabling_, SiStripFedCablingBuilderFromDb::getFedCabling(), LogTrace, m_useanalysis, m_usefec, m_usefed, sistrip::mlESSources_, tTopo, and v_trackercon.

Referenced by checkUpdate().

226  {
228  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]";
229 
230  // Check if DB connection is made
231  if ( db_ ) {
232 
233  // Check if DB connection is made
234  if ( db_->deviceFactory() ||
235  db_->databaseCache() ) {
236 
237  // Build FEC cabling object
238  SiStripFecCabling fec_cabling;
239 
241  fec_cabling,
244 
246  SiStripDetCabling det_cabling( *fed_cabling_, tTopo );
247  buildStripRelatedObjects( &*db_, det_cabling );
248 
249 
253 
254 
255 
256  } else {
258  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
259  << " NULL pointer to DeviceFactory returned by SiStripConfigDb!"
260  << " Cannot build Pedestals object!";
261  }
262  } else {
264  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
265  << " NULL pointer to SiStripConfigDb returned by DB \"service\"!"
266  << " Cannot build Pedestals object!";
267  }
268 }
void buildAnalysisRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
DeviceFactory *const deviceFactory(std::string method_name="") const
edm::Service< SiStripConfigDb > db_
void buildFECRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
void buildStripRelatedObjects(SiStripConfigDb *const db, const SiStripDetCabling &det_cabling)
static void buildFecCabling(SiStripConfigDb *const, SiStripFecCabling &, const sistrip::CablingSource &)
void buildFEDRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
#define LogTrace(id)
DbClient *const databaseCache(std::string method_name="") const
static void getFedCabling(const SiStripFecCabling &in, SiStripFedCabling &out)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static const char mlESSources_[]
vector< const FedChannelConnection * > SiStripCondObjBuilderFromDb::buildConnections ( const SiStripDetCabling det_cabling,
uint32_t  det_id 
)
protected

Definition at line 323 of file SiStripCondObjBuilderFromDb.cc.

References SiStripDetCabling::getConnections(), and sistrip::mlESSources_.

Referenced by buildStripRelatedObjects().

323  {
324  vector<const FedChannelConnection *> conns = det_cabling.getConnections(det_id);
325  if (conns.size()==0){
327  << "SiStripCondObjBuilderFromDb::" << __func__ << "]"
328  << " Unable to build condition object!"
329  << " No FED channel connections found for detid "<< det_id;
330  }
331  return conns;
332 }
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
static const char mlESSources_[]
void SiStripCondObjBuilderFromDb::buildFECRelatedObjects ( SiStripConfigDb *const  db,
const trackercon tc 
)

Definition at line 722 of file SiStripCondObjBuilderFromDb.cc.

References SiStripLatency::compress(), shell::connections, gather_cfg::cout, end, SiStripConfigDb::getDeviceDescriptions(), latency_, SiStripLatency::printDebug(), SiStripLatency::printSummary(), setValuesApvLatency(), and contentValuesCheck::ss.

Referenced by buildCondObj().

722  {
723  trackercon tc = _tc;
724  std::cout << "Entering [SiStripCondObjBuilderFromDb::"<<__func__ <<"]"<<std::endl;
725  //data container
726  latency_ = new SiStripLatency();
727 
728  i_trackercon detids_end=tc.end();
729 
730  // get APV DeviceDescriptions
732 
733 
734  //loop detids
735  for(i_trackercon detids=tc.begin();detids!=detids_end;detids++){
736  uint32_t detid = (*detids).first;
737  uint16_t apvnr=1;
738  i_apvpairconn connections_end=((*detids).second).end();
739 
740 
741  //loop connections
742  for(i_apvpairconn connections=((*detids).second).begin();connections!=connections_end;connections++){
743  uint32_t apvPair =(*connections).first;
744  FedChannelConnection ipair =(*connections).second;
745 
746  //no connection for apvPair found
747  if(apvPair>=100){
748  //setDefaultValuesApvLatency((*latency_),ipair, detid, apvnr);
749  std::cout << "[SiStripCondObjBuilderFromDb::" << __func__ << "] No FEDConnection for DetId " << detid << " ApvPair " << apvPair-100 << " found, skipping Latency Insertion!" << std::endl;
750  continue;
751  }
752 
753  //fill data
754  if(!setValuesApvLatency((*latency_),db, ipair, detid, apvnr, apvs)){
755  std::cout
756  << "\n "
757  << " Unable to find FEC Description"
758  << " Skipping Insertion for DetId: " << detid << std::endl;
759  //setDefaultValuesApvLatency((*latency_),ipair, detid, apvnr);
760  }
761  apvnr+=2;
762  }//connections
763  // compact Latency Object
764 
765  }//detids
766  latency_->compress();
767  std::stringstream ss;
768  // latency debug output
769  latency_->printSummary(ss);
770  latency_->printDebug(ss);
771  std::cout << ss.str() << std::endl;
772 }
bool setValuesApvLatency(SiStripLatency &latency_, SiStripConfigDb *const db, FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr, SiStripConfigDb::DeviceDescriptionsRange apvs)
list connections
Definition: shell.py:10
Class containning control, module, detector and connection information, at the level of a FED channel...
DeviceDescriptions::range DeviceDescriptionsRange
std::vector< pair_detcon > trackercon
#define end
Definition: vmac.h:37
void printSummary(std::stringstream &ss) const
Prints the number of ranges as well as the value of singleLatency and singleMode. ...
void printDebug(std::stringstream &ss) const
Prints the full list of all ranges and corresponding values of latency and mode.
tuple cout
Definition: gather_cfg.py:145
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
std::vector< pair_detcon >::iterator i_trackercon
std::vector< pair_apvpairconn >::iterator i_apvpairconn
void SiStripCondObjBuilderFromDb::buildFEDRelatedObjects ( SiStripConfigDb *const  db,
const trackercon tc 
)

Definition at line 776 of file SiStripCondObjBuilderFromDb.cc.

References shell::connections, gather_cfg::cout, end, FedChannelConnection::fedId(), SiStripConfigDb::getFedDescriptions(), noises_, pedestals_, quality_, setDefaultValuesCabling(), setValuesCabling(), AlCaHarvesting_cff::SiStripQuality, storeNoise(), storePedestals(), storeQuality(), storeThreshold(), and threshold_.

Referenced by buildCondObj().

776  {
777  trackercon tc = _tc;
778  std::cout << "Entering [SiStripCondObjBuilderFromDb::"<<__func__ <<"]"<<std::endl;
779 
780  //data containers
782  noises_ = new SiStripNoises();
784  quality_ = new SiStripQuality();
785 
786  i_trackercon detids_end=tc.end();
787 
788  //Build FED Descriptions out of db object
790 
791  //loop detids
792  for(i_trackercon detids=tc.begin();detids!=detids_end;detids++){
793  uint32_t detid = (*detids).first;
794  i_apvpairconn connections_end=((*detids).second).end();
795 
796  //loop connections
797  for(i_apvpairconn connections=((*detids).second).begin();connections!=connections_end;connections++){
798  uint32_t apvPair =(*connections).first;
799  FedChannelConnection ipair =(*connections).second;
800 
801  //no connection for apvPair found
802  if(apvPair>=100){
803  std::cout
804  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
805  << " Unable to find FED description for FED id: " << ipair.fedId()
806  << " detid : " << detid << " APV pair number " << apvPair
807  << " Writing default values"<< std::endl;
808  setDefaultValuesCabling((apvPair-100));
809  continue;
810  }
811  // if(!setValuesCabling(db, ipair, detid)){
812  if(!setValuesCabling(descriptions, ipair, detid)){
813  std::cout
814  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
815  << " Unable to find FED description for FED id: " << ipair.fedId()
816  << " detid : " << detid << " APV pair number " << apvPair
817  << " Writing default values"<< std::endl;
818  setDefaultValuesCabling(apvPair);
819  }
820  }//connections
821  storePedestals(detid);
822  storeNoise(detid);
823  storeThreshold(detid);
824  storeQuality(detid);
825  }//detids
826 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
const uint16_t & fedId() const
void setDefaultValuesCabling(uint16_t apvPair)
list connections
Definition: shell.py:10
Class containning control, module, detector and connection information, at the level of a FED channel...
std::vector< pair_detcon > trackercon
#define end
Definition: vmac.h:37
bool setValuesCabling(SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid)
tuple cout
Definition: gather_cfg.py:145
std::vector< pair_detcon >::iterator i_trackercon
std::vector< pair_apvpairconn >::iterator i_apvpairconn
void SiStripCondObjBuilderFromDb::buildStripRelatedObjects ( SiStripConfigDb *const  db,
const SiStripDetCabling det_cabling 
)

Definition at line 574 of file SiStripCondObjBuilderFromDb.cc.

References SiStripDetCabling::addActiveDetectorsRawIds(), buildConnections(), gather_cfg::cout, TauDecayModes::dec, sistrip::invalid32_, sistrip::invalid_, sistrip::mlESSources_, p_apvpcon, p_detcon, retrieveFedDescriptions(), retrieveNumberAPVPairs(), v_apvpcon, and v_trackercon.

Referenced by buildCondObj().

575  {
576  //variables needed in this function
577  uint16_t nApvPairs;
578  vector<uint32_t>::const_iterator det_id;
579  vector<uint32_t> det_ids;
580 
582  << "\n[SiStripCondObjBuilderFromDb::" << __func__ << "] first call to this method";
583 
584  //Check if FedDescriptions exist, if not return
585  if (!retrieveFedDescriptions(db)) {std::cout<< "Found no FedDescription!" << std::endl;return;}
586  // Retrieve list of active DetIds
587  det_cabling.addActiveDetectorsRawIds(det_ids);
588  if ( det_ids.empty() ) {
589  std::cout
590  << "SiStripCondObjBuilderFromDb::" << __func__ << "]"
591  << " Unable to build Pedestals object!"
592  << " No DetIds found!" << std::endl;
593  return;
594  }
595  std::cout << "\n\nSiStripCondObjBuilderFromDb::" << __func__ << "]"
596  << " Found " << det_ids.size() << " active DetIds";
597 
598  // Loop Active DetIds
599  det_id = det_ids.begin();
600  for ( ; det_id != det_ids.end(); det_id++ ) {
601  std::stringstream ssMessage;
602 
603  // Ignore NULL DetIds
604  if ( !(*det_id) ) { continue; }
605  if ( *det_id == sistrip::invalid32_ ) { continue; }
606 
607 
608  //build connections per DetId
609  const vector<const FedChannelConnection *>& conns=buildConnections(det_cabling, *det_id);
610 
611  vector<const FedChannelConnection *>::const_iterator ipair = conns.begin();
612  if(conns.size() ==0 ) continue;
613 
614  //retrieve number of APV pairs per detid
615  nApvPairs=retrieveNumberAPVPairs(*det_id);
616 
617 
618  //loop connections and check if APVPair is connected
619  vector< vector<const FedChannelConnection *>::const_iterator > listConns(nApvPairs,conns.end());
620 
621  for ( ; ipair != conns.end(); ++ipair ){
622  // Check if the ApvPair is connected
623  if ( !(*ipair) ) continue;
624  if ((*ipair)->fedId()!=sistrip::invalid_ && (*ipair)->apvPairNumber()<3){
625  // (*ipair)->print(ssMessage);
626  // ssMessage<< std::endl;
627  listConns[ipair-conns.begin()]=ipair;
628  } else {
629  std::cout
630  << "\n impossible to assign connection position in listConns " << std::endl;
631  // (*ipair)->print(ssMessage);
632  // ssMessage << std::endl;
633  }
634  }
635 
636  // get data
637  // vector< vector<const FedChannelConnection *>::const_iterator >::const_iterator ilistConns=listConns.begin();
638  for (uint16_t apvPair=0;apvPair<listConns.size();++apvPair){
639  ipair=listConns[apvPair];
640  if ( ipair == conns.end() ) {
641  // Fill object with default values
642  std::cout
643  << "\n "
644  << " Unable to find FED connection for detid : " << std::dec << *det_id << " APV pair number " << apvPair
645  << " Writing default values" << std::endl;
646 // (*ipair)->print(ssMessage); // this will crash!
647  //If no connection was found, add 100 to apvpair
648  apvPair+=100;
649  std::cout << " Put apvPair+100:" << apvPair << " into vector!" << std::endl;
650  // use dummy FedChannelConnection since it's not used in this case
651  FedChannelConnection dummy;
652  p_apvpcon=std::make_pair(apvPair,dummy);
653  v_apvpcon.push_back(p_apvpcon);
654  apvPair=apvPair-100;
655  continue;
656  }
657  p_apvpcon=std::make_pair(apvPair,**ipair);
658  v_apvpcon.push_back(p_apvpcon);
659  } //conns loop
660  p_detcon=std::make_pair(*det_id,v_apvpcon);
661  v_trackercon.push_back(p_detcon);
662  v_apvpcon.clear();
663  } // det id loop
664 }
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
static const uint32_t invalid32_
Definition: Constants.h:15
bool retrieveFedDescriptions(SiStripConfigDb *const db)
Class containning control, module, detector and connection information, at the level of a FED channel...
uint16_t retrieveNumberAPVPairs(uint32_t det_id)
vector< const FedChannelConnection * > buildConnections(const SiStripDetCabling &det_cabling, uint32_t det_id)
static const uint16_t invalid_
Definition: Constants.h:16
tuple cout
Definition: gather_cfg.py:145
static const char mlESSources_[]
TrackerTopology * SiStripCondObjBuilderFromDb::buildTrackerTopology ( )

Definition at line 81 of file SiStripCondObjBuilderFromDb.cc.

References TrackerTopology::PixelEndcapValues::bladeMask_, TrackerTopology::PixelEndcapValues::bladeStartBit_, TrackerTopology::PixelEndcapValues::diskMask_, TrackerTopology::PixelEndcapValues::diskStartBit_, TrackerTopology::PixelBarrelValues::ladderMask_, TrackerTopology::PixelBarrelValues::ladderStartBit_, TrackerTopology::PixelBarrelValues::layerMask_, TrackerTopology::TIBValues::layerMask_, TrackerTopology::TOBValues::layerMask_, TrackerTopology::PixelBarrelValues::layerStartBit_, TrackerTopology::TIBValues::layerStartBit_, TrackerTopology::TOBValues::layerStartBit_, TrackerTopology::TIDValues::module_fw_bwMask_, TrackerTopology::TIDValues::module_fw_bwStartBit_, TrackerTopology::PixelBarrelValues::moduleMask_, TrackerTopology::PixelEndcapValues::moduleMask_, TrackerTopology::TECValues::moduleMask_, TrackerTopology::TIBValues::moduleMask_, TrackerTopology::TIDValues::moduleMask_, TrackerTopology::TOBValues::moduleMask_, TrackerTopology::PixelBarrelValues::moduleStartBit_, TrackerTopology::PixelEndcapValues::moduleStartBit_, TrackerTopology::TECValues::moduleStartBit_, TrackerTopology::TIBValues::moduleStartBit_, TrackerTopology::TIDValues::moduleStartBit_, TrackerTopology::TOBValues::moduleStartBit_, TrackerTopology::PixelEndcapValues::panelMask_, TrackerTopology::PixelEndcapValues::panelStartBit_, TrackerTopology::TECValues::petal_fw_bwMask_, TrackerTopology::TECValues::petal_fw_bwStartBit_, TrackerTopology::TECValues::petalMask_, TrackerTopology::TECValues::petalStartBit_, TrackerTopology::TECValues::ringMask_, TrackerTopology::TIDValues::ringMask_, TrackerTopology::TECValues::ringStartBit_, TrackerTopology::TIDValues::ringStartBit_, TrackerTopology::TOBValues::rod_fw_bwMask_, TrackerTopology::TOBValues::rod_fw_bwStartBit_, TrackerTopology::TOBValues::rodMask_, TrackerTopology::TOBValues::rodStartBit_, TrackerTopology::PixelEndcapValues::sideMask_, TrackerTopology::TECValues::sideMask_, TrackerTopology::TIDValues::sideMask_, TrackerTopology::PixelEndcapValues::sideStartBit_, TrackerTopology::TECValues::sideStartBit_, TrackerTopology::TIDValues::sideStartBit_, TrackerTopology::TECValues::sterMask_, TrackerTopology::TIBValues::sterMask_, TrackerTopology::TIDValues::sterMask_, TrackerTopology::TOBValues::sterMask_, TrackerTopology::TECValues::sterStartBit_, TrackerTopology::TIBValues::sterStartBit_, TrackerTopology::TIDValues::sterStartBit_, TrackerTopology::TOBValues::sterStartBit_, TrackerTopology::TIBValues::str_fw_bwMask_, TrackerTopology::TIBValues::str_fw_bwStartBit_, TrackerTopology::TIBValues::str_int_extMask_, TrackerTopology::TIBValues::str_int_extStartBit_, TrackerTopology::TIBValues::strMask_, TrackerTopology::TIBValues::strStartBit_, TrackerTopology::TECValues::wheelMask_, TrackerTopology::TIDValues::wheelMask_, TrackerTopology::TECValues::wheelStartBit_, and TrackerTopology::TIDValues::wheelStartBit_.

81  {
88 
89  pxbVals_.layerStartBit_ = 16;
90  pxbVals_.ladderStartBit_ = 8;
91  pxbVals_.moduleStartBit_ = 2;
92  pxbVals_.layerMask_ = 0xF;
93  pxbVals_.ladderMask_ = 0xFF;
94  pxbVals_.moduleMask_ = 0x3F;
95  pxfVals_.sideStartBit_ = 23;
96  pxfVals_.diskStartBit_ = 16;
97  pxfVals_.bladeStartBit_ = 10;
98  pxfVals_.panelStartBit_ = 8;
99  pxfVals_.moduleStartBit_ = 2;
100  pxfVals_.sideMask_ = 0x3;
101  pxfVals_.diskMask_ = 0xF;
102  pxfVals_.bladeMask_ = 0x3F;
103  pxfVals_.panelMask_ = 0x3;
104  pxfVals_.moduleMask_ = 0x3F;
105  tecVals_.sideStartBit_ = 18;
106  tecVals_.wheelStartBit_ = 14;
107  tecVals_.petal_fw_bwStartBit_ = 12;
108  tecVals_.petalStartBit_ = 8;
109  tecVals_.ringStartBit_ = 5;
110  tecVals_.moduleStartBit_ = 2;
111  tecVals_.sterStartBit_ = 0;
112  tecVals_.sideMask_ = 0x3;
113  tecVals_.wheelMask_ = 0xF;
114  tecVals_.petal_fw_bwMask_ = 0x3;
115  tecVals_.petalMask_ = 0xF;
116  tecVals_.ringMask_ = 0x7;
117  tecVals_.moduleMask_ = 0x7;
118  tecVals_.sterMask_ = 0x3;
119  tibVals_.layerStartBit_ = 14;
120  tibVals_.str_fw_bwStartBit_ = 12;
121  tibVals_.str_int_extStartBit_ = 10;
122  tibVals_.strStartBit_ = 4;
123  tibVals_.moduleStartBit_ = 2;
124  tibVals_.sterStartBit_ = 0;
125  tibVals_.layerMask_ = 0x7;
126  tibVals_.str_fw_bwMask_ = 0x3;
127  tibVals_.str_int_extMask_ = 0x3;
128  tibVals_.strMask_ = 0x3F;
129  tibVals_.moduleMask_ = 0x3;
130  tibVals_.sterMask_ = 0x3;
131  tidVals_.sideStartBit_ = 13;
132  tidVals_.wheelStartBit_ = 11;
133  tidVals_.ringStartBit_ = 9;
134  tidVals_.module_fw_bwStartBit_ = 7;
135  tidVals_.moduleStartBit_ = 2;
136  tidVals_.sterStartBit_ = 0;
137  tidVals_.sideMask_ = 0x3;
138  tidVals_.wheelMask_ = 0x3;
139  tidVals_.ringMask_ = 0x3;
140  tidVals_.module_fw_bwMask_ = 0x3;
141  tidVals_.moduleMask_ = 0x1F;
142  tidVals_.sterMask_ = 0x3;
143  tobVals_.layerStartBit_ = 14;
144  tobVals_.rod_fw_bwStartBit_ = 12;
145  tobVals_.rodStartBit_ = 5;
146  tobVals_.moduleStartBit_ = 2;
147  tobVals_.sterStartBit_ = 0;
148  tobVals_.layerMask_ = 0x7;
149  tobVals_.rod_fw_bwMask_ = 0x3;
150  tobVals_.rodMask_ = 0x7F;
151  tobVals_.moduleMask_ = 0x7;
152  tobVals_.sterMask_ = 0x3;
153 
154  return new TrackerTopology(pxbVals_, pxfVals_, tecVals_, tibVals_, tidVals_, tobVals_);
155 }
unsigned int module_fw_bwStartBit_
bool SiStripCondObjBuilderFromDb::checkForCompatibility ( std::stringstream &  input,
std::stringstream &  output,
std::string &  label 
)

Definition at line 158 of file SiStripCondObjBuilderFromDb.cc.

References SiStripPartition::apvTimingVersion(), SiStripPartition::cabVersion(), dbParams(), SiStripPartition::fecVersion(), SiStripPartition::fedVersion(), SiStripPartition::maskVersion(), SiStripPartition::partitionName(), and SiStripDbParams::partitions().

Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::isTransferNeeded().

158  {
159  // DEPRECATED. Superseded by SiStripCondObjBuilderFromDb::getConfigString(const std::type_info& typeInfo).
160 
161  //get current config DB parameter
162 
164 
165  SiStripDbParams::SiStripPartitions::const_iterator ipart = partitionsRange.begin();
166  SiStripDbParams::SiStripPartitions::const_iterator ipartEnd = partitionsRange.end();
167  for ( ; ipart != ipartEnd; ++ipart ) {
168  SiStripPartition partition=ipart->second;
169  output << "@ "
170  << " Partition " << partition.partitionName() ;
171  if (label!="Cabling" && label !="ApvLatency")
172  output << " FedVer " << partition.fedVersion().first << "." << partition.fedVersion().second;
173  if(label=="Cabling")
174  output << " CabVer " << partition.cabVersion().first << "." << partition.cabVersion().second
175  << " MaskVer " << partition.maskVersion().first << "." << partition.maskVersion().second;
176  if(label=="ApvTiming")
177  output<< " ApvTimingVer " << partition.apvTimingVersion().first << "." << partition.apvTimingVersion().second;
178  if(label=="ApvLatency")
179  output<< " FecVersion " << partition.fecVersion().first << "." << partition.fecVersion().second;
180  }
181 
182  if (!strcmp(output.str().c_str(),input.str().c_str()))
183  return false;
184 
185  return true;
186 }
Versions maskVersion() const
std::string partitionName() const
static std::string const input
Definition: EdmProvDump.cc:44
const_iterator_range partitions() const
Versions apvTimingVersion() const
Container class for database partition parameters.
const SiStripDbParams & dbParams() const
boost::iterator_range< SiStripPartitions::const_iterator > const_iterator_range
Versions fecVersion() const
Versions cabVersion() const
Versions fedVersion() const
void SiStripCondObjBuilderFromDb::checkUpdate ( )
protected
const SiStripDbParams& SiStripCondObjBuilderFromDb::dbParams ( ) const
inline

Returns database connection parameters.

Definition at line 67 of file SiStripCondObjBuilderFromDb.h.

References db_, and SiStripConfigDb::dbParams().

Referenced by checkForCompatibility(), checkUpdate(), and getConfigString().

67 {return db_->dbParams();}
edm::Service< SiStripConfigDb > db_
const SiStripDbParams & dbParams() const
SiStripApvGain* SiStripCondObjBuilderFromDb::getApvGain ( )
inline

Definition at line 87 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and gain_.

Referenced by getValue().

SiStripLatency* SiStripCondObjBuilderFromDb::getApvLatency ( )
inline

Definition at line 88 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and latency_.

Referenced by getValue().

std::string SiStripCondObjBuilderFromDb::getConfigString ( const std::type_info &  typeInfo)

Definition at line 189 of file SiStripCondObjBuilderFromDb.cc.

References SiStripPartition::apvTimingVersion(), SiStripPartition::cabVersion(), dbParams(), SiStripPartition::fecVersion(), SiStripPartition::fedVersion(), SiStripPartition::maskVersion(), convertSQLitetoXML_cfg::output, SiStripPartition::partitionName(), and SiStripDbParams::partitions().

189  {
190  // create config line used by fast O2O
191 
192  std::stringstream output;
193 
195  SiStripDbParams::SiStripPartitions::const_iterator ipart = partitionsRange.begin();
196  SiStripDbParams::SiStripPartitions::const_iterator ipartEnd = partitionsRange.end();
197  for ( ; ipart != ipartEnd; ++ipart ) {
198  SiStripPartition partition=ipart->second;
199  output << "%%" << "Partition: " << partition.partitionName();
200 
201  // Make everything depend on cabVersion and maskVersion!
202  output << " CablingVersion: " << partition.cabVersion().first << "." << partition.cabVersion().second;
203  output << " MaskVersion: " << partition.maskVersion().first << "." << partition.maskVersion().second;
204 
205  if(typeInfo==typeid(SiStripFedCabling)){
206  // Do nothing. FedCabling only depends on cabVersion and maskVersion.
207  }
208  else if(typeInfo==typeid(SiStripLatency)){
209  // Latency is FEC related, add fecVersion.
210  output << " FecVersion: " << partition.fecVersion().first << "." << partition.fecVersion().second;
211  }else{
212  // BadStrip, Noises, Pedestals and Thresholds are FED related, add fecVersion.
213  output << " FedVersion: " << partition.fedVersion().first << "." << partition.fedVersion().second;
214  if(typeInfo==typeid(SiStripApvGain)){
215  // Not used in O2O.
216  output << " ApvTimingVersion: " << partition.apvTimingVersion().first << "." << partition.apvTimingVersion().second;
217  }
218  }
219  }
220 
221  return output.str();
222 
223 }
Versions maskVersion() const
std::string partitionName() const
const_iterator_range partitions() const
Versions apvTimingVersion() const
Container class for database partition parameters.
const SiStripDbParams & dbParams() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
boost::iterator_range< SiStripPartitions::const_iterator > const_iterator_range
Versions fecVersion() const
Versions cabVersion() const
Versions fedVersion() const
SiStripFedCabling* SiStripCondObjBuilderFromDb::getFedCabling ( )
inline

Definition at line 82 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and fed_cabling_.

Referenced by getValue().

SiStripNoises* SiStripCondObjBuilderFromDb::getNoises ( )
inline

Definition at line 84 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and noises_.

Referenced by getValue().

SiStripPedestals* SiStripCondObjBuilderFromDb::getPedestals ( )
inline

Definition at line 83 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and pedestals_.

Referenced by getValue().

SiStripQuality* SiStripCondObjBuilderFromDb::getQuality ( )
inline

Definition at line 86 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and quality_.

Referenced by getValue().

SiStripThreshold* SiStripCondObjBuilderFromDb::getThreshold ( )
inline

Definition at line 85 of file SiStripCondObjBuilderFromDb.h.

References checkUpdate(), and threshold_.

Referenced by getValue().

void SiStripCondObjBuilderFromDb::getValue ( SiStripFedCabling *&  val)
inline
void SiStripCondObjBuilderFromDb::getValue ( SiStripPedestals *&  val)
inline

Definition at line 91 of file SiStripCondObjBuilderFromDb.h.

References getPedestals().

91 { val = getPedestals(); }
void SiStripCondObjBuilderFromDb::getValue ( SiStripNoises *&  val)
inline

Definition at line 92 of file SiStripCondObjBuilderFromDb.h.

References getNoises().

92 { val = getNoises(); }
void SiStripCondObjBuilderFromDb::getValue ( SiStripThreshold *&  val)
inline

Definition at line 93 of file SiStripCondObjBuilderFromDb.h.

References getThreshold().

93 { val = getThreshold(); }
void SiStripCondObjBuilderFromDb::getValue ( SiStripQuality *&  val)
inline

Definition at line 94 of file SiStripCondObjBuilderFromDb.h.

References getQuality().

94 { val = getQuality(); }
void SiStripCondObjBuilderFromDb::getValue ( SiStripBadStrip *&  val)
inline

Definition at line 95 of file SiStripCondObjBuilderFromDb.h.

References getQuality().

void SiStripCondObjBuilderFromDb::getValue ( SiStripApvGain *&  val)
inline

Definition at line 96 of file SiStripCondObjBuilderFromDb.h.

References getApvGain().

96 { val = getApvGain(); }
void SiStripCondObjBuilderFromDb::getValue ( SiStripLatency *&  val)
inline

Definition at line 97 of file SiStripCondObjBuilderFromDb.h.

References getApvLatency().

97 { val = getApvLatency(); }
vector< uint32_t > SiStripCondObjBuilderFromDb::retrieveActiveDetIds ( const SiStripDetCabling det_cabling)
protected

Definition at line 304 of file SiStripCondObjBuilderFromDb.cc.

References SiStripDetCabling::addActiveDetectorsRawIds(), LogTrace, and sistrip::mlESSources_.

304  {
305  vector<uint32_t> det_ids;
306  det_cabling.addActiveDetectorsRawIds(det_ids);
307  if ( det_ids.empty() ) {
309  << "SiStripCondObjBuilderFromDb::" << __func__ << "]"
310  << " Unable to build Pedestals object!"
311  << " No DetIds found!";
312  return det_ids;
313  }
315  << "\n\nSiStripCondObjBuilderFromDb::" << __func__ << "]"
316  << " Found " << det_ids.size() << " active DetIds";
317  return det_ids;
318 }
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
#define LogTrace(id)
static const char mlESSources_[]
bool SiStripCondObjBuilderFromDb::retrieveFedDescriptions ( SiStripConfigDb *const  db)
protected

Definition at line 273 of file SiStripCondObjBuilderFromDb.cc.

References SiStripConfigDb::getFedDescriptions(), and sistrip::mlESSources_.

Referenced by buildStripRelatedObjects().

273  {
275  if ( descriptions.empty() ) {
277  << "SiStripCondObjBuilderFromDb::" << __func__ << "]"
278  << " No FED descriptions found!";
279 
280  return false;
281  }
282  return true;
283 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlESSources_[]
uint16_t SiStripCondObjBuilderFromDb::retrieveNumberAPVPairs ( uint32_t  det_id)
protected

Definition at line 337 of file SiStripCondObjBuilderFromDb.cc.

References SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), and cppFunctionSkipper::operator.

Referenced by buildStripRelatedObjects().

337  {
338  uint16_t nApvPairs;
340  nApvPairs=fr->getNumberOfApvsAndStripLength(det_id).first/2;
341  return nApvPairs;
342 }
bool SiStripCondObjBuilderFromDb::retrieveTimingAnalysisDescriptions ( SiStripConfigDb *const  db)
protected

Definition at line 288 of file SiStripCondObjBuilderFromDb.cc.

References SiStripConfigDb::getAnalysisDescriptions(), and sistrip::mlESSources_.

Referenced by buildAnalysisRelatedObjects().

288  {
289  SiStripConfigDb::AnalysisDescriptionsRange anal_descriptions =
290  db->getAnalysisDescriptions( CommissioningAnalysisDescription::T_ANALYSIS_TIMING );
291  if ( anal_descriptions.empty() ) {
293  << "SiStripCondObjBuilderFromDb::" << __func__ << "]"
294  << " Unable to build SiStripApvGain object!"
295  << " No timing-scan analysis descriptions found!";
296  return false;
297  }
298  return true;
299 }
AnalysisDescriptionsRange getAnalysisDescriptions(AnalysisType, std::string partition="")
AnalysisDescriptions::range AnalysisDescriptionsRange
static const char mlESSources_[]
void SiStripCondObjBuilderFromDb::setDefaultValuesApvLatency ( SiStripLatency latency_,
const FedChannelConnection ipair,
uint32_t  detid,
uint16_t  apvnr 
)
protected

Definition at line 367 of file SiStripCondObjBuilderFromDb.cc.

References gather_cfg::cout, m_defaultapvlatencyvalue, m_defaultapvmodevalue, and SiStripLatency::put().

367  {
368  std::cout << "[SiStripCondObjBuilderFromDb::"<<__func__<<"]: Set Default Latency for Detid: " << detid << " ApvNr: " << apvnr << std::endl;
369  if(!latency_.put( detid, apvnr, m_defaultapvmodevalue, m_defaultapvlatencyvalue))
370  {
371  std::cout << "[SiStripCondObjBuilderFromDb::"<<__func__<<"]: Unable to fill Latency for Detid: " << detid << " ApvNr: " << apvnr << std::endl;
372  }
373  if(!latency_.put( detid, ++apvnr, m_defaultapvmodevalue, m_defaultapvlatencyvalue))
374  {
375  std::cout << "[SiStripCondObjBuilderFromDb::"<<__func__<<"]: Unable to fill Latency for Detid: " << detid << " ApvNr: " << apvnr << std::endl;
376  }
377 
378 }
bool put(const uint32_t detId, const uint16_t apv, const uint16_t latency, const uint16_t mode)
tuple cout
Definition: gather_cfg.py:145
void SiStripCondObjBuilderFromDb::setDefaultValuesApvTiming ( )
protected
void SiStripCondObjBuilderFromDb::setDefaultValuesCabling ( uint16_t  apvPair)
protected

Definition at line 347 of file SiStripCondObjBuilderFromDb.cc.

References gather_cfg::cout, SiStripBadStrip::encode(), inputNoises, inputPedestals, inputQuality, inputThreshold, m_defaultnoisevalue, m_defaultpedestalvalue, m_defaultthresholdhighvalue, m_defaultthresholdlowvalue, noises_, pedestals_, quality_, SiStripPedestals::setData(), SiStripNoises::setData(), SiStripThreshold::setData(), sistrip::STRIPS_PER_FEDCH, and threshold_.

Referenced by buildFEDRelatedObjects().

347  {
348  uint16_t istrip = apvPair*sistrip::STRIPS_PER_FEDCH;
349  std::cout << "Found disabled FedConnection! APVPair: " << apvPair << " Strips: " << sistrip::STRIPS_PER_FEDCH << std::endl;
350  inputQuality.push_back(quality_->encode(istrip,sistrip::STRIPS_PER_FEDCH));
351  for ( ;istrip < (apvPair+1)*sistrip::STRIPS_PER_FEDCH; ++istrip ){
355  }
356 }
SiStripPedestals::InputVector inputPedestals
SiStripQuality::InputVector inputQuality
SiStripThreshold::InputVector inputThreshold
SiStripNoises::InputVector inputNoises
static const uint16_t STRIPS_PER_FEDCH
void setData(const uint16_t &strip, const float &lTh, const float &hTh, Container &vthr)
void setData(float ped, InputVector &vped)
tuple cout
Definition: gather_cfg.py:145
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
void setData(float noise_, InputVector &vped)
bool SiStripCondObjBuilderFromDb::setValuesApvLatency ( SiStripLatency latency_,
SiStripConfigDb *const  db,
FedChannelConnection ipair,
uint32_t  detid,
uint16_t  apvnr,
SiStripConfigDb::DeviceDescriptionsRange  apvs 
)
protected

Definition at line 414 of file SiStripCondObjBuilderFromDb.cc.

References FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), gather_cfg::cout, TauDecayModes::dec, FedChannelConnection::fecCrate(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), FedChannelConnection::i2cAddr(), cppFunctionSkipper::operator, and SiStripLatency::put().

Referenced by buildFECRelatedObjects().

414  {
416  fr->getNumberOfApvsAndStripLength(detid);
417 
418  SiStripConfigDb::DeviceDescriptionsV::const_iterator iapv = apvs.begin();
419  SiStripConfigDb::DeviceDescriptionsV::const_iterator japv = apvs.end();
420  if(iapv==japv) return false;
421  for ( ; iapv != japv; ++iapv ) {
422  apvDescription* apv = dynamic_cast<apvDescription*>( *iapv );
423  if ( !apv ) { continue; }
424  if((apv->getCrateId()) != (ipair.fecCrate())) continue;
425  if((apv->getFecSlot()) != (ipair.fecSlot())) continue;
426  if((apv->getRingSlot()) != (ipair.fecRing())) continue;
427  if((apv->getCcuAddress()) != (ipair.ccuAddr())) continue;
428  if((apv->getChannel()) != (ipair.ccuChan())) continue;
429  // Insert latency values into latency object
430  if((apv->getAddress()) == (ipair.i2cAddr(0))) {
431  if(!latency_.put( detid, apvnr, static_cast<uint16_t>(apv->getLatency()), static_cast<uint16_t>(apv->getApvMode()))){
432  std::cout << "UNABLE APVLatency Put: Detid "<< dec<<detid
433  << " APVNr.: " << apvnr
434  << " Latency Value: " << dec <<static_cast<uint16_t>(apv->getLatency())
435  << " APV Mode: " << dec<< static_cast<uint16_t>(apv->getApvMode())
436  << std::endl;
437  return false;
438  }else{++apvnr;}
439  }
440  if((apv->getAddress()) == (ipair.i2cAddr(1))) {
441  if(!latency_.put( detid, apvnr, static_cast<uint16_t>(apv->getLatency()), static_cast<uint16_t>(apv->getApvMode()))){
442  std::cout << "UNABLE APVLatency Put: Detid "<<dec<< detid
443  << " APVNr.: " << apvnr
444  << " Latency Value: " << dec <<static_cast<uint16_t>(apv->getLatency())
445  << " APV Mode: " << dec <<static_cast<uint16_t>(apv->getApvMode())
446  << std::endl;
447  continue;
448  return false;
449  }else{++apvnr;}
450  }
451  }
452  return true;
453 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
bool put(const uint32_t detId, const uint16_t apv, const uint16_t latency, const uint16_t mode)
const uint16_t & fecRing() const
const uint16_t & ccuChan() const
const uint16_t & ccuAddr() const
tuple cout
Definition: gather_cfg.py:145
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
bool SiStripCondObjBuilderFromDb::setValuesApvTiming ( SiStripConfigDb *const  db,
FedChannelConnection ipair 
)
protected

Definition at line 384 of file SiStripCondObjBuilderFromDb.cc.

References SiStripFedKey::fedCh(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), SiStripConfigDb::getAnalysisDescriptions(), inputApvGain, m_defaulttickheightvalue, m_gaincalibrationfactor, and tmp.

Referenced by buildAnalysisRelatedObjects().

384  {
385  SiStripConfigDb::AnalysisDescriptionsRange anal_descriptions = db->getAnalysisDescriptions( CommissioningAnalysisDescription::T_ANALYSIS_TIMING );
386  SiStripConfigDb::AnalysisDescriptionsV::const_iterator iii = anal_descriptions.begin();
387  SiStripConfigDb::AnalysisDescriptionsV::const_iterator jjj = anal_descriptions.end();
388 
389  while ( iii != jjj ) {
390  CommissioningAnalysisDescription* tmp = *iii;
391  uint16_t fed_id = tmp->getFedId();
392  uint16_t fed_ch = SiStripFedKey::fedCh( tmp->getFeUnit(), tmp->getFeChan() );
393  if ( fed_id == ipair.fedId() && fed_ch == ipair.fedCh() ) { break; }
394  iii++;
395  }
396 
397  TimingAnalysisDescription *anal=0;
398  if ( iii != jjj ) { anal = dynamic_cast<TimingAnalysisDescription*>(*iii); }
399  if ( anal ) {
400  float tick_height = (anal->getHeight() / m_gaincalibrationfactor);
401  inputApvGain.push_back( tick_height ); // APV0
402  inputApvGain.push_back( tick_height); // APV1
403  } else {
406  return false;
407  }
408 
409  return true;
410 }
const uint16_t & fedCh() const
const uint16_t & fedId() const
AnalysisDescriptionsRange getAnalysisDescriptions(AnalysisType, std::string partition="")
AnalysisDescriptions::range AnalysisDescriptionsRange
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
SiStripApvGain::InputVector inputApvGain
static uint16_t fedCh(const uint16_t &fe_unit, const uint16_t &fe_chan)
bool SiStripCondObjBuilderFromDb::setValuesCabling ( SiStripConfigDb::FedDescriptionsRange descriptions,
FedChannelConnection ipair,
uint32_t  detid 
)
protected

Definition at line 458 of file SiStripCondObjBuilderFromDb.cc.

References FedChannelConnection::apvPairNumber(), gather_cfg::cout, idDealer::description, SiStripBadStrip::encode(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), inputNoises, inputPedestals, inputQuality, inputThreshold, noises_, pedestals_, quality_, SiStripPedestals::setData(), SiStripNoises::setData(), SiStripThreshold::setData(), RecoTauPiZeroBuilderPlugins_cfi::strips, sistrip::STRIPS_PER_FEDCH, and threshold_.

Referenced by buildFEDRelatedObjects().

458  {
459  //SiStripConfigDb::FedDescriptionsRange descriptions = db->getFedDescriptions();
460  SiStripConfigDb::FedDescriptionsV::const_iterator description = descriptions.begin();
461  while ( description != descriptions.end() ) {
462  if ( (*description)->getFedId() ==ipair.fedId() ) { break; }
463  description++;
464  }
465  if ( description == descriptions.end() ) {return false;}
466  // Retrieve Fed9UStrips object from FED description
467  const Fed9U::Fed9UStrips& strips = (*description)->getFedStrips();
468 
469 
470  // Retrieve StripDescriptions for each APV
471  uint16_t jstrip = ipair.apvPairNumber()*sistrip::STRIPS_PER_FEDCH;
472  for ( uint16_t iapv = 2*ipair.fedCh(); iapv < 2*ipair.fedCh()+2; iapv++ ) {
473 
474  // Get StripDescriptions for the given APV
475  Fed9U::Fed9UAddress addr;
476  addr.setFedApv(iapv);
477  vector<Fed9U::Fed9UStripDescription> strip = strips.getApvStrips(addr);
478 
479  vector<Fed9U::Fed9UStripDescription>::const_iterator istrip = strip.begin();
480 
481  for ( ; istrip != strip.end(); istrip++ ) {
482  pedestals_->setData( istrip->getPedestal() , inputPedestals);
483  noises_ ->setData( istrip->getNoise() , inputNoises );
484  threshold_->setData( jstrip, istrip->getLowThresholdFactor(),
485  istrip->getHighThresholdFactor(), inputThreshold );
486  if(istrip->getDisable()){
487  std::cout << "Found disabled strip! Detid: " << detid << " APVNr: " << iapv << " Strips: " << jstrip << std::endl;
488 
489  inputQuality.push_back(quality_->encode(jstrip,1));
490  }
491  jstrip++;
492  }
493  }
494  return true;
495 }
SiStripPedestals::InputVector inputPedestals
const uint16_t & fedCh() const
SiStripQuality::InputVector inputQuality
uint16_t apvPairNumber() const
SiStripThreshold::InputVector inputThreshold
const uint16_t & fedId() const
SiStripNoises::InputVector inputNoises
tuple description
Definition: idDealer.py:66
static const uint16_t STRIPS_PER_FEDCH
void setData(const uint16_t &strip, const float &lTh, const float &hTh, Container &vthr)
void setData(float ped, InputVector &vped)
tuple cout
Definition: gather_cfg.py:145
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
void setData(float noise_, InputVector &vped)
void SiStripCondObjBuilderFromDb::storeNoise ( uint32_t  det_id)
protected

Definition at line 516 of file SiStripCondObjBuilderFromDb.cc.

References gather_cfg::cout, inputNoises, noises_, and SiStripNoises::put().

Referenced by buildFEDRelatedObjects().

516  {
517  // Insert noise values into Noises object
518 
519  if ( !noises_->put(det_id, inputNoises ) ) {
520  std::cout
521  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
522  << " Unable to insert values into SiStripNoises object!"
523  << " DetId already exists!" << std::endl;
524  }
525  inputNoises.clear();
526 
527  }
SiStripNoises::InputVector inputNoises
bool put(const uint32_t &detID, const InputVector &input)
tuple cout
Definition: gather_cfg.py:145
void SiStripCondObjBuilderFromDb::storePedestals ( uint32_t  det_id)
protected

Definition at line 501 of file SiStripCondObjBuilderFromDb.cc.

References gather_cfg::cout, inputPedestals, pedestals_, and SiStripPedestals::put().

Referenced by buildFEDRelatedObjects().

501  {
502  if ( !pedestals_->put(det_id, inputPedestals ) ) {
503  std::cout
504  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
505  << " Unable to insert values into SiStripPedestals object!"
506  << " DetId already exists!" << std::endl;
507  }
508  inputPedestals.clear();
509 
510  }
SiStripPedestals::InputVector inputPedestals
bool put(const uint32_t &detID, InputVector &input)
tuple cout
Definition: gather_cfg.py:145
void SiStripCondObjBuilderFromDb::storeQuality ( uint32_t  det_id)
protected

Definition at line 544 of file SiStripCondObjBuilderFromDb.cc.

References SiStripQuality::compact(), gather_cfg::cout, inputQuality, SiStripBadStrip::put(), and quality_.

Referenced by buildFEDRelatedObjects().

544  {
545  // Insert quality values into Quality object
546  if (inputQuality.size()){
547  quality_->compact(det_id,inputQuality);
548  if ( !quality_->put(det_id, inputQuality ) ) {
549  std::cout
550  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
551  << " Unable to insert values into SiStripQuality object!"
552  << " DetId already exists!" << std::endl;
553  }
554  }
555  inputQuality.clear();
556 }
SiStripQuality::InputVector inputQuality
void compact(unsigned int &, std::vector< unsigned int > &)
tuple cout
Definition: gather_cfg.py:145
bool put(const uint32_t &detID, const InputVector &vect)
void SiStripCondObjBuilderFromDb::storeThreshold ( uint32_t  det_id)
protected

Definition at line 531 of file SiStripCondObjBuilderFromDb.cc.

References gather_cfg::cout, inputThreshold, SiStripThreshold::put(), and threshold_.

Referenced by buildFEDRelatedObjects().

531  {
532  // Insert threshold values into Threshold object
533  if ( !threshold_->put(det_id, inputThreshold ) ) {
534  std::cout
535  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
536  << " Unable to insert values into SiStripThreshold object!"
537  << " DetId already exists!" << std::endl;
538  }
539  inputThreshold.clear();
540 }
bool put(const uint32_t &detID, const InputVector &vect)
SiStripThreshold::InputVector inputThreshold
tuple cout
Definition: gather_cfg.py:145
void SiStripCondObjBuilderFromDb::storeTiming ( uint32_t  det_id)
protected

Definition at line 560 of file SiStripCondObjBuilderFromDb.cc.

References gain_, inputApvGain, sistrip::mlESSources_, and SiStripApvGain::put().

Referenced by buildAnalysisRelatedObjects().

560  {
561  // Insert tick height values into Gain object
562  SiStripApvGain::Range range( inputApvGain.begin(), inputApvGain.end() );
563  if ( !gain_->put( det_id, range ) ) {
565  << "[SiStripCondObjBuilderFromDb::" << __func__ << "]"
566  << " Unable to insert values into SiStripApvGain object!"
567  << " DetId already exists!";
568  }
569  inputApvGain.clear();
570 }
bool put(const uint32_t &detID, Range input)
std::pair< ContainerIterator, ContainerIterator > Range
SiStripApvGain::InputVector inputApvGain
static const char mlESSources_[]

Member Data Documentation

edm::Service<SiStripConfigDb> SiStripCondObjBuilderFromDb::db_
protected

Access to the configuration DB interface class.

Definition at line 106 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildAnalysisRelatedObjects(), buildCondObj(), and dbParams().

SiStripDbParams SiStripCondObjBuilderFromDb::dbParams_
protected

Container for DB connection parameters.

Definition at line 109 of file SiStripCondObjBuilderFromDb.h.

Referenced by checkUpdate().

SiStripFedCabling* SiStripCondObjBuilderFromDb::fed_cabling_
protected

Definition at line 110 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj(), and getFedCabling().

SiStripApvGain* SiStripCondObjBuilderFromDb::gain_
protected
SiStripApvGain::InputVector SiStripCondObjBuilderFromDb::inputApvGain
protected
SiStripNoises::InputVector SiStripCondObjBuilderFromDb::inputNoises
protected
SiStripPedestals::InputVector SiStripCondObjBuilderFromDb::inputPedestals
protected
SiStripQuality::InputVector SiStripCondObjBuilderFromDb::inputQuality
protected
SiStripThreshold::InputVector SiStripCondObjBuilderFromDb::inputThreshold
protected
SiStripLatency* SiStripCondObjBuilderFromDb::latency_
protected

Definition at line 116 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildFECRelatedObjects(), and getApvLatency().

bool SiStripCondObjBuilderFromDb::m_debug
protected

Definition at line 153 of file SiStripCondObjBuilderFromDb.h.

uint16_t SiStripCondObjBuilderFromDb::m_defaultapvlatencyvalue
protected

Definition at line 148 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesApvLatency().

uint16_t SiStripCondObjBuilderFromDb::m_defaultapvmodevalue
protected

Definition at line 147 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesApvLatency().

float SiStripCondObjBuilderFromDb::m_defaultnoisevalue
protected

Definition at line 144 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesCabling().

float SiStripCondObjBuilderFromDb::m_defaultpedestalvalue
protected

Definition at line 143 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesCabling().

float SiStripCondObjBuilderFromDb::m_defaultthresholdhighvalue
protected

Definition at line 145 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesCabling().

float SiStripCondObjBuilderFromDb::m_defaultthresholdlowvalue
protected

Definition at line 146 of file SiStripCondObjBuilderFromDb.h.

Referenced by setDefaultValuesCabling().

float SiStripCondObjBuilderFromDb::m_defaulttickheightvalue
protected
float SiStripCondObjBuilderFromDb::m_gaincalibrationfactor
protected
bool SiStripCondObjBuilderFromDb::m_useanalysis
protected

Definition at line 150 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj().

bool SiStripCondObjBuilderFromDb::m_usefec
protected

Definition at line 152 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj().

bool SiStripCondObjBuilderFromDb::m_usefed
protected

Definition at line 151 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj().

SiStripNoises* SiStripCondObjBuilderFromDb::noises_
protected
pair_apvpairconn SiStripCondObjBuilderFromDb::p_apvpcon
protected

Definition at line 165 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildStripRelatedObjects().

pair_detcon SiStripCondObjBuilderFromDb::p_detcon
protected

Definition at line 167 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildStripRelatedObjects().

SiStripPedestals* SiStripCondObjBuilderFromDb::pedestals_
protected
SiStripQuality* SiStripCondObjBuilderFromDb::quality_
protected
SiStripThreshold* SiStripCondObjBuilderFromDb::threshold_
protected
TrackerTopology* SiStripCondObjBuilderFromDb::tTopo
protected

Definition at line 156 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj(), and ~SiStripCondObjBuilderFromDb().

v_apvpairconn SiStripCondObjBuilderFromDb::v_apvpcon
protected

Definition at line 166 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildStripRelatedObjects().

trackercon SiStripCondObjBuilderFromDb::v_trackercon
protected

Definition at line 168 of file SiStripCondObjBuilderFromDb.h.

Referenced by buildCondObj(), and buildStripRelatedObjects().