CMS 3D CMS Logo

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

#include <CalibTracker/SiPixelTools/src/SiPixelOfflineCalibAnalysisBase.cc>

Inheritance diagram for SiPixelOfflineCalibAnalysisBase:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase SiPixelGainCalibrationAnalysis SiPixelIsAliveCalibration SiPixelSCurveCalibrationAnalysis

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void addTF1ToDQMMonitoringElement (MonitorElement *ele, TF1 *func)
 
MonitorElementbookDQMHistogram1D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
 
MonitorElementbookDQMHistogram1D (uint32_t detid, std::string name, std::string title, int nchX, float *xbinsize)
 
MonitorElementbookDQMHistogram2D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 
MonitorElementbookDQMHistoPlaquetteSummary2D (uint32_t detid, std::string name, std::string title)
 
virtual bool doFits (uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
 
std::vector< uint32_t > & getRunNumbers ()
 
bool setDQMDirectory (std::string dirName)
 
bool setDQMDirectory (uint32_t detID)
 
 SiPixelOfflineCalibAnalysisBase (const edm::ParameterSet &)
 
 SiPixelOfflineCalibAnalysisBase ()
 
std::string translateDetIdToString (uint32_t detid)
 
 ~SiPixelOfflineCalibAnalysisBase () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static const std::vector< short > * getVcalValues ()
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Static Public Attributes

static TF1 * fitFunction_ = nullptr
 

Protected Member Functions

uint32_t & EventNumber ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Protected Attributes

edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdcablingMapToken_
 
edm::ESHandle< SiPixelCalibConfigurationcalib_
 
std::string calibrationMode_
 
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcdcalibToken_
 
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcdcalibTokenBeginRun_
 
edm::ESHandle< TrackerGeometrygeom_
 
short nTriggers_
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 

Static Protected Attributes

static std::vector< short > vCalValues_
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void calibrationEnd ()
 
virtual void calibrationSetup (const edm::EventSetup &iSetup)
 
virtual bool checkCorrectCalibrationType ()
 
bool checkPixel (uint32_t detid, short row, short column)
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void newDetID (uint32_t detid)
 

Private Attributes

bool createOutputFile_
 
DQMStoredaqBE_
 
std::map< uint32_t, std::string > detIdNames_
 
std::map< uint32_t, int > detIdsEntered_
 
uint32_t eventCounter_
 
SiPixelFolderOrganizerfolderMaker_
 
std::string outputFileName_
 
std::vector< uint32_t > runnumbers_
 
edm::InputTag siPixelCalibDigiProducer_
 
SiPixelHistogramIdtheHistogramIdWorker_
 
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigi > > tPixelCalibDigi
 

Detailed Description

Description: Base class for Pixel calibrations

Implementation: <Notes on="" implementation>="">

Definition at line 60 of file SiPixelOfflineCalibAnalysisBase.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 63 of file SiPixelOfflineCalibAnalysisBase.h.

◆ MonitorElement

Definition at line 62 of file SiPixelOfflineCalibAnalysisBase.h.

Constructor & Destructor Documentation

◆ SiPixelOfflineCalibAnalysisBase() [1/2]

SiPixelOfflineCalibAnalysisBase::SiPixelOfflineCalibAnalysisBase ( const edm::ParameterSet iConfig)
explicit

Definition at line 37 of file SiPixelOfflineCalibAnalysisBase.cc.

References cablingMapToken_, calibToken_, calibTokenBeginRun_, createOutputFile_, daqBE_, folderMaker_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputFileName_, siPixelCalibDigiProducer_, AlCaHLTBitMon_QueryRunRegistry::string, tPixelCalibDigi, and trackerGeomToken_.

38  : runnumbers_(0), eventCounter_(0) {
39  siPixelCalibDigiProducer_ = iConfig.getParameter<edm::InputTag>("DetSetVectorSiPixelCalibDigiTag");
40  createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile", false);
41  outputFileName_ = iConfig.getParameter<std::string>("outputFileName");
44  tPixelCalibDigi = consumes<edm::DetSetVector<SiPixelCalibDigi> >(siPixelCalibDigiProducer_);
45 
47  esConsumes<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd, edm::Transition::BeginRun>();
48  calibToken_ = esConsumes<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd>();
49  trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
50  cablingMapToken_ = esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd>();
51 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibToken_
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibTokenBeginRun_
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigi > > tPixelCalibDigi

◆ ~SiPixelOfflineCalibAnalysisBase()

SiPixelOfflineCalibAnalysisBase::~SiPixelOfflineCalibAnalysisBase ( )
override

Definition at line 60 of file SiPixelOfflineCalibAnalysisBase.cc.

60 {}

◆ SiPixelOfflineCalibAnalysisBase() [2/2]

SiPixelOfflineCalibAnalysisBase::SiPixelOfflineCalibAnalysisBase ( )

Definition at line 53 of file SiPixelOfflineCalibAnalysisBase.cc.

References Exception.

53  {
54  throw cms::Exception("") << "ERROR: Classes derived from SiPixelOfflineCalibAnalysisBase must call "
55  "SiPixelOfflineCalibAnalysisBase::SiPixelOfflineCalibAnalysisBase(const "
56  "edm::ParameterSet& iConfig) from their constructor."
57  << std::endl;
58 }

Member Function Documentation

◆ addTF1ToDQMMonitoringElement()

void SiPixelOfflineCalibAnalysisBase::addTF1ToDQMMonitoringElement ( MonitorElement ele,
TF1 *  func 
)

Definition at line 305 of file SiPixelOfflineCalibAnalysisBase.cc.

References EcalMonitorTask_cff::func, and dqm::legacy::MonitorElement::getTH1().

305  {
306  if (func) {
307  ele->getTH1()->GetListOfFunctions()->Add(func);
308  }
309  return;
310 }
virtual TH1 * getTH1() const

◆ analyze()

void SiPixelOfflineCalibAnalysisBase::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 67 of file SiPixelOfflineCalibAnalysisBase.cc.

References edm::DetSetVector< T >::begin(), cablingMapToken_, calib_, calibrationSetup(), calibToken_, checkCorrectCalibrationType(), hcalRecHitTable_cff::detId, detIdNames_, detIdsEntered_, doFits(), edm::DetSetVector< T >::end(), eventCounter_, geom_, edm::EventSetup::getHandle(), iEvent, newDetID(), cond::runnumber, runnumbers_, theCablingMap_, tPixelCalibDigi, trackerGeomToken_, and translateDetIdToString().

67  {
68  using namespace edm;
69 
70  calib_ = iSetup.getHandle(calibToken_);
73  if (eventCounter_ == 0)
74  this->calibrationSetup(iSetup);
75  eventCounter_++;
76 
77  // check first if you're analyzing the right type of calibration
79  return;
80 
81  uint32_t runnumber = iEvent.id().run();
82  if (runnumbers_.empty())
83  runnumbers_.push_back(runnumber);
84  else {
85  bool foundnumber = false;
86  for (size_t iter = 0; iter < runnumbers_.size() && !foundnumber; ++iter) {
87  if (runnumbers_[iter] == runnumber) {
88  foundnumber = true;
89  continue;
90  }
91  }
92  if (!foundnumber)
93  runnumbers_.push_back(runnumber);
94  }
95 
97  iEvent.getByToken(tPixelCalibDigi, thePlaquettes);
98 
100 
101  //loop over the plaquettes pulsed in this pattern
102  for (digiIter = thePlaquettes->begin(); digiIter != thePlaquettes->end(); ++digiIter) {
103  uint32_t detId = digiIter->id;
104  //check to see if this detID has not been encountered. If not, run the newDetID (pure virtual) function
105  if (detIdsEntered_.find(detId) == detIdsEntered_.end()) {
106  detIdsEntered_.insert(std::make_pair(detId, 0));
107  detIdNames_.insert(std::make_pair(detId, translateDetIdToString(detId)));
108  newDetID(detId);
109  }
111  //loop over pixels pulsed in the current plaquette
112  for (ipix = digiIter->data.begin(); ipix != digiIter->end(); ++ipix) {
113  //called derived function to fit this curve
114  this->doFits(detId, ipix);
115  }
116  }
117 }
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::map< uint32_t, std::string > detIdNames_
std::string translateDetIdToString(uint32_t detid)
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibToken_
edm::ESHandle< TrackerGeometry > geom_
virtual void calibrationSetup(const edm::EventSetup &iSetup)
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:316
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
HLT enums.
virtual bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:305
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigi > > tPixelCalibDigi

◆ beginJob()

void SiPixelOfflineCalibAnalysisBase::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 137 of file SiPixelOfflineCalibAnalysisBase.cc.

137 {}

◆ beginRun()

void SiPixelOfflineCalibAnalysisBase::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 119 of file SiPixelOfflineCalibAnalysisBase.cc.

References calibrationMode_, calibrationSetup(), calibTokenBeginRun_, gather_cfg::cout, edm::EventSetup::getHandle(), edm::InputTag::label(), nTriggers_, siPixelCalibDigiProducer_, theHistogramIdWorker_, and vCalValues_.

119  {
120  //load the calibration information from the database
122 
123  calibrationMode_ = calib->getCalibrationMode();
124  nTriggers_ = calib->getNTriggers();
125  vCalValues_ = calib->getVCalValues();
126  std::cout << "!!!! in beginRun" << std::endl;
127  edm::LogInfo("SiPixelOfflineCalibAnalysisBase")
128  << "Calibration file loaded. Mode: " << calibrationMode_ << " nTriggers: " << nTriggers_
129  << " Vcal steps: " << vCalValues_.size() << std::endl;
130  //call calibrationSetup virtual function
131  this->calibrationSetup(iSetup);
133 }
std::string const & label() const
Definition: InputTag.h:36
virtual void calibrationSetup(const edm::EventSetup &iSetup)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
Log< level::Info, false > LogInfo
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibTokenBeginRun_

◆ bookDQMHistogram1D() [1/2]

SiPixelOfflineCalibAnalysisBase::MonitorElement * SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D ( uint32_t  detid,
std::string  name,
std::string  title,
int  nchX,
double  lowX,
double  highX 
)

◆ bookDQMHistogram1D() [2/2]

SiPixelOfflineCalibAnalysisBase::MonitorElement * SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D ( uint32_t  detid,
std::string  name,
std::string  title,
int  nchX,
float *  xbinsize 
)

Definition at line 186 of file SiPixelOfflineCalibAnalysisBase.cc.

References dqm::implementation::IBooker::book1D(), daqBE_, Skims_PA_cff::name, SiPixelHistogramId::setHistoId(), AlCaHLTBitMon_QueryRunRegistry::string, theHistogramIdWorker_, and runGCPTkAlMap::title.

187  {
189  return daqBE_->book1D(hid, title, nchX, xbinsize);
190 }
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookDQMHistogram2D()

SiPixelOfflineCalibAnalysisBase::MonitorElement * SiPixelOfflineCalibAnalysisBase::bookDQMHistogram2D ( uint32_t  detid,
std::string  name,
std::string  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Definition at line 192 of file SiPixelOfflineCalibAnalysisBase.cc.

References dqm::implementation::IBooker::book2D(), daqBE_, Skims_PA_cff::name, SiPixelHistogramId::setHistoId(), AlCaHLTBitMon_QueryRunRegistry::string, theHistogramIdWorker_, and runGCPTkAlMap::title.

200  {
202  return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY);
203 }
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212

◆ bookDQMHistoPlaquetteSummary2D()

SiPixelOfflineCalibAnalysisBase::MonitorElement * SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D ( uint32_t  detid,
std::string  name,
std::string  title 
)

Definition at line 205 of file SiPixelOfflineCalibAnalysisBase.cc.

References dqm::implementation::IBooker::book2D(), daqBE_, hcalRecHitTable_cff::detId, geom_, TrackerGeometry::idToDet(), Skims_PA_cff::name, PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelHistogramId::setHistoId(), PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, theHistogramIdWorker_, and runGCPTkAlMap::title.

Referenced by SiPixelIsAliveCalibration::newDetID(), SiPixelGainCalibrationAnalysis::newDetID(), and SiPixelSCurveCalibrationAnalysis::newDetID().

206  {
207  DetId detId(detid);
208  const TrackerGeometry& theTracker(*geom_);
209  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId));
210  int maxcol = theGeomDet->specificTopology().ncolumns();
211  int maxrow = theGeomDet->specificTopology().nrows();
212 
214  return daqBE_->book2D(hid, title, maxcol, 0, maxcol, maxrow, 0, maxrow);
215 }
virtual int ncolumns() const =0
virtual int nrows() const =0
edm::ESHandle< TrackerGeometry > geom_
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:17
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.

◆ calibrationEnd()

void SiPixelOfflineCalibAnalysisBase::calibrationEnd ( )
privatevirtual

Reimplemented in SiPixelSCurveCalibrationAnalysis, SiPixelGainCalibrationAnalysis, and SiPixelIsAliveCalibration.

Definition at line 251 of file SiPixelOfflineCalibAnalysisBase.cc.

Referenced by endJob().

251  {
252  // do nothing
253 }

◆ calibrationSetup()

void SiPixelOfflineCalibAnalysisBase::calibrationSetup ( const edm::EventSetup iSetup)
privatevirtual

Reimplemented in SiPixelSCurveCalibrationAnalysis, SiPixelGainCalibrationAnalysis, and SiPixelIsAliveCalibration.

Definition at line 247 of file SiPixelOfflineCalibAnalysisBase.cc.

Referenced by analyze(), and beginRun().

247  {
248  //do nothing
249 }

◆ checkCorrectCalibrationType()

bool SiPixelOfflineCalibAnalysisBase::checkCorrectCalibrationType ( )
privatevirtual

Reimplemented in SiPixelSCurveCalibrationAnalysis, SiPixelGainCalibrationAnalysis, and SiPixelIsAliveCalibration.

Definition at line 227 of file SiPixelOfflineCalibAnalysisBase.cc.

Referenced by analyze().

227 { return true; }

◆ checkPixel()

bool SiPixelOfflineCalibAnalysisBase::checkPixel ( uint32_t  detid,
short  row,
short  column 
)
private

Definition at line 260 of file SiPixelOfflineCalibAnalysisBase.cc.

References calib_, cuy::col, sipixelobjects::ElectronicIndex::dcol, sipixelobjects::LocalPixel::DcolPxid::dcol, hgcalTestNeighbor_cfi::detector, PixelSLinkDataInputSource_cfi::fedid, SiPixelCalibConfiguration::getColumnPattern(), SiPixelCalibConfiguration::getRowPattern(), edm::ESHandle< T >::product(), sipixelobjects::ElectronicIndex::pxid, sipixelobjects::LocalPixel::DcolPxid::pxid, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), and theCablingMap_.

260  {
261  // finds the fed ID:
262  int thefedid = -1;
263  for (int fedid = 0; fedid <= 40 && thefedid == -1; ++fedid) {
265  if (converter.hasDetUnit(detid)) {
266  thefedid = fedid;
267  }
268  }
269  if (thefedid == -1)
270  return false; // fed ID not associated with det ID. No pattern check possible
271 
272  SiPixelFrameConverter formatter(theCablingMap_.product(), thefedid);
275 
276  formatter.toCabling(cabling, detector);
277  // cabling should now contain cabling.roc and cabling.dcol and cabling.pxid
278 
279  // however, the coordinates now need to be converted from dcl, pxid to the row,col coordinates used in the calibration info
281  loc.dcol = cabling.dcol;
282  loc.pxid = cabling.pxid;
283  sipixelobjects::LocalPixel locpixel(loc);
284  short localrow = locpixel.rocRow();
285  short localcol = locpixel.rocCol();
286 
287  // now get the patterns from the calib object:
288  std::vector<short> calibcols = calib_->getColumnPattern();
289  std::vector<short> calibrows = calib_->getRowPattern();
290  // first check rows:
291  for (size_t irow = 0; irow < calibrows.size(); ++irow) {
292  if (calibrows[irow] == localrow) {
293  // check the columns
294  for (size_t icol = 0; icol < calibcols.size(); ++icol) {
295  if (calibcols[icol] == localcol)
296  return true;
297  }
298  }
299  }
300 
301  return false;
302 }
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::vector< short > getColumnPattern() const
std::vector< short > getRowPattern() const
identify pixel inside single ROC
Definition: LocalPixel.h:7
T const * product() const
Definition: ESHandle.h:86
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
col
Definition: cuy.py:1009
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_

◆ doFits()

bool SiPixelOfflineCalibAnalysisBase::doFits ( uint32_t  detid,
std::vector< SiPixelCalibDigi >::const_iterator  ipix 
)
virtual

Reimplemented in SiPixelSCurveCalibrationAnalysis, SiPixelGainCalibrationAnalysis, and SiPixelIsAliveCalibration.

Definition at line 229 of file SiPixelOfflineCalibAnalysisBase.cc.

References cuy::col, gather_cfg::cout, and mps_fire::i.

Referenced by analyze().

229  {
230  short row = ipix->row();
231  short col = ipix->col();
232  std::vector<uint8_t> nentries = ipix->getnentries();
233  std::vector<uint32_t> sum = ipix->getsum();
234  std::vector<uint32_t> sumquares = ipix->getsumsquares();
235  //do nothing
236  //return false;
237  //
238  //DEBUG
239  std::cout << "Row: " << row << " Col: " << col << std::endl;
240  for (unsigned int i = 0; i < sum.size(); i++) {
241  std::cout << sum[i] << " ";
242  }
243  std::cout << std::endl;
244  return false;
245 }
col
Definition: cuy.py:1009

◆ endJob()

void SiPixelOfflineCalibAnalysisBase::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 141 of file SiPixelOfflineCalibAnalysisBase.cc.

References calibrationEnd(), createOutputFile_, daqBE_, outputFileName_, and dqm::implementation::DQMStore::save().

Referenced by o2olib.O2ORunMgr::executeJob().

141  {
142  this->calibrationEnd();
143  edm::LogInfo("SiPixelOfflineCalibAnalysisBase") << "Running end job... output file name is: " << outputFileName_;
144  if (!outputFileName_.empty() && createOutputFile_) {
145  edm::LogInfo("SiPixelOfflineCalibAnalysisBase") << "Writing ROOT file to: " << outputFileName_ << std::endl;
147  }
148 }
Log< level::Info, false > LogInfo
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:824

◆ endRun()

void SiPixelOfflineCalibAnalysisBase::endRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 135 of file SiPixelOfflineCalibAnalysisBase.cc.

135 {}

◆ EventNumber()

uint32_t& SiPixelOfflineCalibAnalysisBase::EventNumber ( )
inlineprotected

◆ getRunNumbers()

std::vector<uint32_t>& SiPixelOfflineCalibAnalysisBase::getRunNumbers ( )
inline

Definition at line 104 of file SiPixelOfflineCalibAnalysisBase.h.

References runnumbers_.

104 { return runnumbers_; }

◆ getVcalValues()

const std::vector< short > * SiPixelOfflineCalibAnalysisBase::getVcalValues ( )
static

◆ newDetID()

void SiPixelOfflineCalibAnalysisBase::newDetID ( uint32_t  detid)
privatevirtual

Reimplemented in SiPixelSCurveCalibrationAnalysis, SiPixelGainCalibrationAnalysis, and SiPixelIsAliveCalibration.

Definition at line 254 of file SiPixelOfflineCalibAnalysisBase.cc.

References detIdNames_.

Referenced by analyze().

254  {
255  //do nothing
256  edm::LogInfo("SiPixelOfflineCalibAnalysisBase")
257  << "SiPixelOfflineCalibAnalysisBase - Found new DetID: " << detid << " Name: " << detIdNames_[detid];
258 }
std::map< uint32_t, std::string > detIdNames_
Log< level::Info, false > LogInfo

◆ setDQMDirectory() [1/2]

bool SiPixelOfflineCalibAnalysisBase::setDQMDirectory ( std::string  dirName)

◆ setDQMDirectory() [2/2]

bool SiPixelOfflineCalibAnalysisBase::setDQMDirectory ( uint32_t  detID)

Definition at line 222 of file SiPixelOfflineCalibAnalysisBase.cc.

References folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().

222  {
223  return folderMaker_->setModuleFolder(detID, 0);
224 }
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.

◆ translateDetIdToString()

std::string SiPixelOfflineCalibAnalysisBase::translateDetIdToString ( uint32_t  detid)

Definition at line 154 of file SiPixelOfflineCalibAnalysisBase.cc.

References hcalRecHitTable_cff::detId, detIdNames_, PixelBarrelName::name(), PixelEndcapName::name(), convertSQLitetoXML_cfg::output, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze(), SiPixelSCurveCalibrationAnalysis::buildACurveHistogram(), SiPixelIsAliveCalibration::calibrationEnd(), SiPixelGainCalibrationAnalysis::doFits(), SiPixelIsAliveCalibration::newDetID(), SiPixelGainCalibrationAnalysis::newDetID(), SiPixelSCurveCalibrationAnalysis::newDetID(), and SiPixelGainCalibrationAnalysis::printSummary().

154  {
155  std::map<uint32_t, std::string>::iterator detNameIter = detIdNames_.find(detid);
156  if (detNameIter != detIdNames_.end()) {
157  return detNameIter->second;
158  }
159  std::string output = "DetID translation error";
160  DetId detId(detid);
161  uint32_t detSubId = detId.subdetId();
162  if (detSubId > 2 || detSubId < 1) {
163  edm::LogError("SiPixelOfflineCalibAnalysisBase")
164  << "ERROR: Expected a pixel detector ID (1 - barrel, 2 - forward) but got " << detSubId << std::endl;
165  return output;
166  }
167  if (detSubId == 2) //FPIX
168  {
169  PixelEndcapName nameworker(detid);
170  output = nameworker.name();
171  } else //BPIX
172  {
173  PixelBarrelName nameworker(detid);
174  output = nameworker.name();
175  }
176  detIdNames_.insert(std::make_pair(detid, output));
177  return output;
178 }
std::map< uint32_t, std::string > detIdNames_
Log< level::Error, false > LogError
Definition: DetId.h:17
Definition: output.py:1

Member Data Documentation

◆ cablingMapToken_

edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> SiPixelOfflineCalibAnalysisBase::cablingMapToken_
protected

Definition at line 115 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and SiPixelOfflineCalibAnalysisBase().

◆ calib_

edm::ESHandle<SiPixelCalibConfiguration> SiPixelOfflineCalibAnalysisBase::calib_
protected

◆ calibrationMode_

std::string SiPixelOfflineCalibAnalysisBase::calibrationMode_
protected

◆ calibToken_

edm::ESGetToken<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd> SiPixelOfflineCalibAnalysisBase::calibToken_
protected

Definition at line 113 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and SiPixelOfflineCalibAnalysisBase().

◆ calibTokenBeginRun_

edm::ESGetToken<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd> SiPixelOfflineCalibAnalysisBase::calibTokenBeginRun_
protected

Definition at line 112 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by beginRun(), and SiPixelOfflineCalibAnalysisBase().

◆ createOutputFile_

bool SiPixelOfflineCalibAnalysisBase::createOutputFile_
private

Definition at line 127 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by endJob(), and SiPixelOfflineCalibAnalysisBase().

◆ daqBE_

DQMStore* SiPixelOfflineCalibAnalysisBase::daqBE_
private

◆ detIdNames_

std::map<uint32_t, std::string> SiPixelOfflineCalibAnalysisBase::detIdNames_
private

Definition at line 135 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), newDetID(), and translateDetIdToString().

◆ detIdsEntered_

std::map<uint32_t, int> SiPixelOfflineCalibAnalysisBase::detIdsEntered_
private

Definition at line 134 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze().

◆ eventCounter_

uint32_t SiPixelOfflineCalibAnalysisBase::eventCounter_
private

Definition at line 130 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and EventNumber().

◆ fitFunction_

TF1 * SiPixelOfflineCalibAnalysisBase::fitFunction_ = nullptr
static

◆ folderMaker_

SiPixelFolderOrganizer* SiPixelOfflineCalibAnalysisBase::folderMaker_
private

◆ geom_

edm::ESHandle<TrackerGeometry> SiPixelOfflineCalibAnalysisBase::geom_
protected

Definition at line 109 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and bookDQMHistoPlaquetteSummary2D().

◆ nTriggers_

short SiPixelOfflineCalibAnalysisBase::nTriggers_
protected

◆ outputFileName_

std::string SiPixelOfflineCalibAnalysisBase::outputFileName_
private

Definition at line 126 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by endJob(), and SiPixelOfflineCalibAnalysisBase().

◆ runnumbers_

std::vector<uint32_t> SiPixelOfflineCalibAnalysisBase::runnumbers_
private

Definition at line 129 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and getRunNumbers().

◆ siPixelCalibDigiProducer_

edm::InputTag SiPixelOfflineCalibAnalysisBase::siPixelCalibDigiProducer_
private

Definition at line 137 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by beginRun(), and SiPixelOfflineCalibAnalysisBase().

◆ theCablingMap_

edm::ESHandle<SiPixelFedCablingMap> SiPixelOfflineCalibAnalysisBase::theCablingMap_
protected

◆ theHistogramIdWorker_

SiPixelHistogramId* SiPixelOfflineCalibAnalysisBase::theHistogramIdWorker_
private

◆ tPixelCalibDigi

edm::EDGetTokenT<edm::DetSetVector<SiPixelCalibDigi> > SiPixelOfflineCalibAnalysisBase::tPixelCalibDigi
private

Definition at line 139 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and SiPixelOfflineCalibAnalysisBase().

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelOfflineCalibAnalysisBase::trackerGeomToken_
protected

Definition at line 114 of file SiPixelOfflineCalibAnalysisBase.h.

Referenced by analyze(), and SiPixelOfflineCalibAnalysisBase().

◆ vCalValues_

std::vector< short > SiPixelOfflineCalibAnalysisBase::vCalValues_
staticprotected