CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
cms::SiPixelCondObjAllPayloadsReader Class Reference
Inheritance diagram for cms::SiPixelCondObjAllPayloadsReader:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 
 SiPixelCondObjAllPayloadsReader (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 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 void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

TH1F * _TH1F_Gains_all
 
std::map< uint32_t, TH1F * > _TH1F_Gains_m
 
TH1F * _TH1F_Gains_sum
 
TH1F * _TH1F_Pedestals_all
 
std::map< uint32_t, TH1F * > _TH1F_Pedestals_m
 
TH1F * _TH1F_Pedestals_sum
 
std::unique_ptr< SiPixelGainCalibrationServiceBaseSiPixelGainCalibrationService_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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)
 

Detailed Description

Definition at line 51 of file SiPixelCondObjAllPayloadsReader.cc.

Constructor & Destructor Documentation

◆ SiPixelCondObjAllPayloadsReader()

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

Definition at line 81 of file SiPixelCondObjAllPayloadsReader.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), TFileService::kSharedResource, HLT_2023v12_cff::payloadType, SiPixelGainCalibrationService_, and AlCaHLTBitMon_QueryRunRegistry::string.

83  usesResource(TFileService::kSharedResource);
84  std::string payloadType = conf.getParameter<std::string>("payloadType");
85  if (strcmp(payloadType.c_str(), "HLT") == 0) {
86  SiPixelGainCalibrationService_ = std::make_unique<SiPixelGainCalibrationForHLTService>(conf, consumesCollector());
87  } else if (strcmp(payloadType.c_str(), "Offline") == 0) {
89  std::make_unique<SiPixelGainCalibrationOfflineService>(conf, consumesCollector());
90  } else if (strcmp(payloadType.c_str(), "Full") == 0) {
91  SiPixelGainCalibrationService_ = std::make_unique<SiPixelGainCalibrationService>(conf, consumesCollector());
92  }
93  }
static const std::string kSharedResource
Definition: TFileService.h:76
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< SiPixelGainCalibrationServiceBase > SiPixelGainCalibrationService_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_

Member Function Documentation

◆ analyze()

void SiPixelCondObjAllPayloadsReader::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 95 of file SiPixelCondObjAllPayloadsReader.cc.

References _TH1F_Gains_all, _TH1F_Gains_m, _TH1F_Gains_sum, _TH1F_Pedestals_all, _TH1F_Pedestals_m, _TH1F_Pedestals_sum, TrackerGeometry::dets(), compareTotals::fs, PedestalClient_cfi::gain, edm::EventSetup::getData(), TrackerGeometry::idToDetUnit(), TFileDirectory::make(), Skims_PA_cff::name, hgcalPlots::ncols, PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelGainCalibrationService_, PixelGeomDetUnit::specificTopology(), and tkGeomToken_.

95  {
96  //Create Subdirectories
98  TFileDirectory subDirPed = fs->mkdir("Pedestals");
99  TFileDirectory subDirGain = fs->mkdir("Gains");
100  char name[128];
101 
102  unsigned int nmodules = 0;
103  uint32_t nchannels = 0;
104 
105  // Get the calibration data
106  SiPixelGainCalibrationService_->setESObjects(iSetup);
107  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
108  << "[SiPixelCondObjAllPayloadsReader::beginJob] End Reading CondObjects" << std::endl;
109 
110  // Get the Geometry
111  const TrackerGeometry* tkgeom = &iSetup.getData(tkGeomToken_);
112  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
113  << " There are " << tkgeom->dets().size() << " detectors" << std::endl;
114 
115  //Get list of DetIDs
116  std::vector<uint32_t> vdetId_ = SiPixelGainCalibrationService_->getDetIds();
117 
118  //Create histograms
119  _TH1F_Gains_sum = fs->make<TH1F>("Summary_Gain", "Gain Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
121  fs->make<TH1F>("Summary_Pedestal", "Pedestal Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
122  _TH1F_Pedestals_all = fs->make<TH1F>("PedestalsAll", "all Pedestals", 350, -100, 250);
123  _TH1F_Gains_all = fs->make<TH1F>("GainsAll", "all Gains", 100, 0, 10);
124 
125  // Loop over DetId's
126  int ibin = 1;
127  for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(); detid_iter != vdetId_.end();
128  detid_iter++) {
129  uint32_t detid = *detid_iter;
130 
131  sprintf(name, "Pedestals_%d", detid);
132  _TH1F_Pedestals_m[detid] = subDirPed.make<TH1F>(name, name, 250, 0., 250.);
133  sprintf(name, "Gains_%d", detid);
134  _TH1F_Gains_m[detid] = subDirGain.make<TH1F>(name, name, 100, 0., 10.);
135 
136  DetId detIdObject(detid);
137  const PixelGeomDetUnit* _PixelGeomDetUnit =
138  dynamic_cast<const PixelGeomDetUnit*>(tkgeom->idToDetUnit(DetId(detid)));
139  if (_PixelGeomDetUnit == nullptr) {
140  edm::LogError("SiPixelCondObjDisplay") << "[SiPixelCondObjAllPayloadsReader::beginJob] the detID " << detid
141  << " doesn't seem to belong to Tracker" << std::endl;
142  continue;
143  }
144 
145  nmodules++;
146 
147  const GeomDetUnit* geoUnit = tkgeom->idToDetUnit(detIdObject);
148  const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
149  const PixelTopology& topol = pixDet->specificTopology();
150 
151  // Get the module sizes.
152  int nrows = topol.nrows(); // rows in x
153  int ncols = topol.ncolumns(); // cols in y
154 
155  for (int col_iter = 0; col_iter < ncols; col_iter++) {
156  for (int row_iter = 0; row_iter < nrows; row_iter++) {
157  nchannels++;
158 
159  float gain = SiPixelGainCalibrationService_->getGain(detid, col_iter, row_iter);
160  _TH1F_Gains_m[detid]->Fill(gain);
161  _TH1F_Gains_all->Fill(gain);
162 
163  float ped = SiPixelGainCalibrationService_->getPedestal(detid, col_iter, row_iter);
164  _TH1F_Pedestals_m[detid]->Fill(ped);
165  _TH1F_Pedestals_all->Fill(ped);
166 
167  //edm::LogPrint("SiPixelCondObjAllPayloadsReader") << " Col "<<col_iter<<" Row "<<row_iter<<" Ped "<<ped<<" Gain "<<gain<<std::endl;
168  }
169  }
170 
171  _TH1F_Gains_sum->SetBinContent(ibin, _TH1F_Gains_m[detid]->GetMean());
172  _TH1F_Gains_sum->SetBinError(ibin, _TH1F_Gains_m[detid]->GetRMS());
173  _TH1F_Pedestals_sum->SetBinContent(ibin, _TH1F_Pedestals_m[detid]->GetMean());
174  _TH1F_Pedestals_sum->SetBinError(ibin, _TH1F_Pedestals_m[detid]->GetRMS());
175 
176  ibin++;
177  }
178 
179  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
180  << "[SiPixelCondObjAllPayloadsReader::analyze] ---> PIXEL Modules " << nmodules << std::endl;
181  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
182  << "[SiPixelCondObjAllPayloadsReader::analyze] ---> PIXEL Channels " << nchannels << std::endl;
183  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual int ncolumns() const =0
virtual int nrows() const =0
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Log< level::Error, false > LogError
T * make(const Args &...args) const
make new ROOT object
std::unique_ptr< SiPixelGainCalibrationServiceBase > SiPixelGainCalibrationService_
Log< level::Info, false > LogInfo
Definition: DetId.h:17
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_

◆ endJob()

void SiPixelCondObjAllPayloadsReader::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 186 of file SiPixelCondObjAllPayloadsReader.cc.

186  {
187  edm::LogPrint("SiPixelCondObjAllPayloadsReader") << " ---> End job " << std::endl;
188  }
Log< level::Warning, true > LogPrint

◆ fillDescriptions()

void SiPixelCondObjAllPayloadsReader::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 74 of file SiPixelCondObjAllPayloadsReader.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

74  {
76  desc.setComment("EDAnalyzer to read per-module SiPixelGainCalibration payloads in the EventSetup, for any type");
77  desc.add<std::string>("payloadType", "HLT");
78  descriptions.addWithDefaultLabel(desc);
79  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ _TH1F_Gains_all

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Gains_all
private

Definition at line 67 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Gains_m

std::map<uint32_t, TH1F*> cms::SiPixelCondObjAllPayloadsReader::_TH1F_Gains_m
private

Definition at line 64 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Gains_sum

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Gains_sum
private

Definition at line 65 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_all

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Pedestals_all
private

Definition at line 68 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_m

std::map<uint32_t, TH1F*> cms::SiPixelCondObjAllPayloadsReader::_TH1F_Pedestals_m
private

Definition at line 63 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_sum

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Pedestals_sum
private

Definition at line 66 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ SiPixelGainCalibrationService_

std::unique_ptr<SiPixelGainCalibrationServiceBase> cms::SiPixelCondObjAllPayloadsReader::SiPixelGainCalibrationService_
private

Definition at line 61 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze(), and SiPixelCondObjAllPayloadsReader().

◆ tkGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> cms::SiPixelCondObjAllPayloadsReader::tkGeomToken_
private

Definition at line 60 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().