1 #ifndef PixelCalibConfiguration_h 2 #define PixelCalibConfiguration_h 37 class PixelHdwAddress;
79 void nextFECState(std::map<unsigned int, PixelFECConfigInterface*>& pixelFECs,
82 std::map<pos::PixelModuleName,pos::PixelMaskBase*>*
masks,
83 std::map<pos::PixelModuleName,pos::PixelTrimBase*>* trims,
84 std::map<pos::PixelModuleName,pos::PixelDACSettings*>* dacss,
85 unsigned int state)
const;
90 std::map <unsigned int, std::set<unsigned int> > getFEDsAndChannels (
PixelNameTranslation *translation);
99 std::set <unsigned int> getTKFECCrates(
const PixelPortcardMap *portcardmap,
const std::map<std::string,PixelPortCardConfig*>& mapNamePortCard,
const PixelTKFECConfig* tkfecconfig)
const;
101 unsigned int nROC()
const { assert(rocAndModuleListsBuilt_);
return nROC_; }
107 for(
unsigned int i=0;
i<dacs_.size();
i++) {
108 points*=nScanPoints(
i);
113 unsigned int nTriggersTotal()
const {
return nConfigurations()*nTriggersPerPattern();}
115 bool noHits()
const {
return (maxNumHitsPerROC()==0);}
116 unsigned int maxNumHitsPerROC()
const;
119 std::set< std::pair<unsigned int, unsigned int> > pixelsWithHits(
unsigned int state)
const;
123 bool scanningROCForState(
PixelROCName roc,
unsigned int state)
const;
126 return scanCounter(iScan(dac),state);
130 return scanValue(iScan(dac), state, roc);
135 assert( !(dacs_[iScan(dac)].mixValuesAcrossROCs()) );
136 return scanValue(iScan(dac), state, 0, 1);
153 const std::vector<std::vector<unsigned int> > &
columnList()
const {
return cols_;}
154 const std::vector<std::vector<unsigned int> > &
rowList()
const {
return rows_;}
155 const std::vector<PixelROCName>&
rocList()
const {assert(rocAndModuleListsBuilt_);
return rocs_;}
156 const std::set <PixelModuleName>&
moduleList()
const {assert(rocAndModuleListsBuilt_);
return modules_;}
157 const std::set <PixelChannel>&
channelList()
const {assert( objectsDependingOnTheNameTranslationBuilt_ );
return channels_;}
181 std::ofstream *out1 =
nullptr,
182 std::ofstream *out2 =
nullptr 184 void writeXML( std::ofstream *out,
185 std::ofstream *out1 =
nullptr ,
186 std::ofstream *out2 =
nullptr )
const override;
187 void writeXMLTrailer( std::ofstream *out,
188 std::ofstream *out1 =
nullptr,
189 std::ofstream *out2 =
nullptr 196 unsigned int rowCounter(
unsigned int state)
const;
199 unsigned int colCounter(
unsigned int state)
const;
202 unsigned int scanROC(
unsigned int state)
const;
204 unsigned int nScanPoints(
unsigned int iscan)
const {
return dacs_[iscan].getNPoints(); }
206 unsigned int scanCounter(
unsigned int iscan,
unsigned int state)
const;
208 unsigned int scanValue(
unsigned int iscan,
unsigned int state,
unsigned int ROCNumber,
unsigned int ROCsOnChannel)
const;
209 unsigned int scanValue(
unsigned int iscan,
unsigned int state,
PixelROCName roc)
const;
211 std::vector<unsigned int>
scanValues(
unsigned int iscan)
const {
return dacs_[iscan].values();}
213 double scanValueMin(
unsigned int iscan)
const {
return dacs_[iscan].first();}
214 double scanValueMax(
unsigned int iscan)
const {
return dacs_[iscan].first()+
215 dacs_[iscan].step()*(nScanPoints(iscan)-1);}
216 double scanValueStep(
unsigned int iscan)
const {
return dacs_[iscan].step();}
220 void buildROCAndModuleListsFromROCSet(
const std::set<PixelROCName>& rocSet);
224 unsigned int ROCNumberOnChannelAmongThoseCalibrated(
PixelROCName roc)
const;
225 unsigned int numROCsCalibratedOnChannel(
PixelROCName roc)
const;
229 std::vector<std::vector<unsigned int> >
rows_;
230 std::vector<std::vector<unsigned int> >
cols_;
232 mutable std::vector<PixelROCName>
rocs_;
249 std::vector<PixelDACScanRange>
dacs_;
263 unsigned int irows,
unsigned int icols,
269 unsigned int irows,
unsigned int icols,
bool rocAndModuleListsBuilt_
This class specifies which TKFEC boards are used and how they are addressed.
This class specifies which detector components are used in the configuration (and eventually should s...
std::vector< std::vector< unsigned int > > rows_
This class specifies which FEC boards are used and how they are addressed.
unsigned int nScanPoints() const
This file contains the base class for "pixel configuration data" management.
unsigned int numberOfScanVariables() const
std::set< PixelChannel > channels_
unsigned int scanValue(std::string dac, unsigned int state) const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > fedCardsAndChannels_
PixelROCTrimBits * trims_
const std::set< PixelModuleName > & moduleList() const
This class provides the mapping between portcards and the modules controlled by the card...
unsigned int nROC() const
std::string mode() const override
std::vector< PixelROCInfo > rocInfo_
double scanValueMin(unsigned int iscan) const
double scanValueStep(unsigned int iscan) const
This class specifies which FEC boards are used and how they are addressed.
unsigned int nParameters() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
bool objectsDependingOnTheNameTranslationBuilt_
unsigned int nTriggersTotal() const
std::vector< PixelDACScanRange > dacs_
const std::vector< std::vector< unsigned int > > & columnList() const
This class provides a translation from the naming documents standard to specify the ROC to the corres...
const PixelHdwAddress * hdwadd_
bool scanValuesMixedAcrossROCs(std::string dac) const
This file contains the base class for "pixel configuration data" management.
std::vector< std::pair< unsigned int, unsigned int > > defaultDACs_
Base class for pixel calibration procedures.
This class intends to define an abstract interface for the commands to talk to the PixelFEC...
This class specifies which TKFEC boards are used and how they are addressed.
This class implements the steps that are used in a scan over Threshold and CalDelay.
unsigned int nScanPoints(unsigned int iscan) const
const std::vector< PixelROCName > & rocList() const
std::vector< unsigned int > scanValues(std::string dac) const
This is the documentation about PixelDetectorConfig...
Store mfec, mfecchannel etc.
unsigned int nConfigurations() const
std::vector< std::string > rocListInstructions_
double scanValueMax(std::string dac) const
double scanValueMax(unsigned int iscan) const
This class provide a base class for the pixel ROC dac data for the pixel FEC configuration.
PixelROCMaskBits * masks_
std::vector< unsigned int > scanValues(unsigned int iscan) const
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
unsigned int scanCounter(std::string dac, unsigned int state) const
double scanValueMin(std::string dac) const
std::set< PixelModuleName > modules_
This class provides a base class for the pixel trim data for the pixel FEC configuration.
double scanValueStep(std::string dac) const
std::map< std::string, std::string > parameters_
const std::set< PixelChannel > & channelList() const
This is the documentation about PixelNameTranslation...
std::vector< int > old_irows
bool scanValuesMixedAcrossROCs(unsigned int iscan) const
const std::vector< std::vector< unsigned int > > & rowList() const
unsigned int nTriggersPerPattern() const
constexpr uint32_t masks[]
This is the documentation about PixelFEDConfig...
std::vector< PixelROCName > rocs_
std::string scanName(unsigned int iscan) const
std::string getStreamedContent(void) const
unsigned int nPixelPatterns() const
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
unsigned int nScanPoints(std::string dac) const
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
This class specifies the settings on the TKPCIFEC and the settings on the portcard.
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
std::vector< std::vector< unsigned int > > cols_
std::string calibFileContent_
This class stores the name and related hardware mappings for a ROC.
std::map< std::string, std::string > parametersList() const
std::vector< int > old_icols