CMS 3D CMS Logo

List of all members | 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 72 of file SiPixelCondObjAllPayloadsReader.cc.

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

74  usesResource(TFileService::kSharedResource);
75  std::string payloadType = conf.getParameter<std::string>("payloadType");
76  if (strcmp(payloadType.c_str(), "HLT") == 0) {
77  SiPixelGainCalibrationService_ = std::make_unique<SiPixelGainCalibrationForHLTService>(conf, consumesCollector());
78  } else if (strcmp(payloadType.c_str(), "Offline") == 0) {
80  std::make_unique<SiPixelGainCalibrationOfflineService>(conf, consumesCollector());
81  } else if (strcmp(payloadType.c_str(), "Full") == 0) {
82  SiPixelGainCalibrationService_ = std::make_unique<SiPixelGainCalibrationService>(conf, consumesCollector());
83  }
84  }
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 86 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_.

86  {
87  //Create Subdirectories
89  TFileDirectory subDirPed = fs->mkdir("Pedestals");
90  TFileDirectory subDirGain = fs->mkdir("Gains");
91  char name[128];
92 
93  unsigned int nmodules = 0;
94  uint32_t nchannels = 0;
95 
96  // Get the calibration data
97  SiPixelGainCalibrationService_->setESObjects(iSetup);
98  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
99  << "[SiPixelCondObjAllPayloadsReader::beginJob] End Reading CondObjects" << std::endl;
100 
101  // Get the Geometry
102  const TrackerGeometry* tkgeom = &iSetup.getData(tkGeomToken_);
103  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
104  << " There are " << tkgeom->dets().size() << " detectors" << std::endl;
105 
106  //Get list of DetIDs
107  std::vector<uint32_t> vdetId_ = SiPixelGainCalibrationService_->getDetIds();
108 
109  //Create histograms
110  _TH1F_Gains_sum = fs->make<TH1F>("Summary_Gain", "Gain Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
112  fs->make<TH1F>("Summary_Pedestal", "Pedestal Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
113  _TH1F_Pedestals_all = fs->make<TH1F>("PedestalsAll", "all Pedestals", 350, -100, 250);
114  _TH1F_Gains_all = fs->make<TH1F>("GainsAll", "all Gains", 100, 0, 10);
115 
116  // Loop over DetId's
117  int ibin = 1;
118  for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(); detid_iter != vdetId_.end();
119  detid_iter++) {
120  uint32_t detid = *detid_iter;
121 
122  sprintf(name, "Pedestals_%d", detid);
123  _TH1F_Pedestals_m[detid] = subDirPed.make<TH1F>(name, name, 250, 0., 250.);
124  sprintf(name, "Gains_%d", detid);
125  _TH1F_Gains_m[detid] = subDirGain.make<TH1F>(name, name, 100, 0., 10.);
126 
127  DetId detIdObject(detid);
128  const PixelGeomDetUnit* _PixelGeomDetUnit =
129  dynamic_cast<const PixelGeomDetUnit*>(tkgeom->idToDetUnit(DetId(detid)));
130  if (_PixelGeomDetUnit == nullptr) {
131  edm::LogError("SiPixelCondObjDisplay") << "[SiPixelCondObjAllPayloadsReader::beginJob] the detID " << detid
132  << " doesn't seem to belong to Tracker" << std::endl;
133  continue;
134  }
135 
136  nmodules++;
137 
138  const GeomDetUnit* geoUnit = tkgeom->idToDetUnit(detIdObject);
139  const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
140  const PixelTopology& topol = pixDet->specificTopology();
141 
142  // Get the module sizes.
143  int nrows = topol.nrows(); // rows in x
144  int ncols = topol.ncolumns(); // cols in y
145 
146  for (int col_iter = 0; col_iter < ncols; col_iter++) {
147  for (int row_iter = 0; row_iter < nrows; row_iter++) {
148  nchannels++;
149 
150  float gain = SiPixelGainCalibrationService_->getGain(detid, col_iter, row_iter);
151  _TH1F_Gains_m[detid]->Fill(gain);
152  _TH1F_Gains_all->Fill(gain);
153 
154  float ped = SiPixelGainCalibrationService_->getPedestal(detid, col_iter, row_iter);
155  _TH1F_Pedestals_m[detid]->Fill(ped);
156  _TH1F_Pedestals_all->Fill(ped);
157 
158  //edm::LogPrint("SiPixelCondObjAllPayloadsReader") << " Col "<<col_iter<<" Row "<<row_iter<<" Ped "<<ped<<" Gain "<<gain<<std::endl;
159  }
160  }
161 
162  _TH1F_Gains_sum->SetBinContent(ibin, _TH1F_Gains_m[detid]->GetMean());
163  _TH1F_Gains_sum->SetBinError(ibin, _TH1F_Gains_m[detid]->GetRMS());
164  _TH1F_Pedestals_sum->SetBinContent(ibin, _TH1F_Pedestals_m[detid]->GetMean());
165  _TH1F_Pedestals_sum->SetBinError(ibin, _TH1F_Pedestals_m[detid]->GetRMS());
166 
167  ibin++;
168  }
169 
170  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
171  << "[SiPixelCondObjAllPayloadsReader::analyze] ---> PIXEL Modules " << nmodules << std::endl;
172  edm::LogInfo("SiPixelCondObjAllPayloadsReader")
173  << "[SiPixelCondObjAllPayloadsReader::analyze] ---> PIXEL Channels " << nchannels << std::endl;
174  }
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_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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 177 of file SiPixelCondObjAllPayloadsReader.cc.

177  {
178  edm::LogPrint("SiPixelCondObjAllPayloadsReader") << " ---> End job " << std::endl;
179  }
Log< level::Warning, true > LogPrint

Member Data Documentation

◆ _TH1F_Gains_all

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Gains_all
private

Definition at line 66 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Gains_m

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

Definition at line 63 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Gains_sum

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Gains_sum
private

Definition at line 64 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_all

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Pedestals_all
private

Definition at line 67 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_m

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

Definition at line 62 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ _TH1F_Pedestals_sum

TH1F* cms::SiPixelCondObjAllPayloadsReader::_TH1F_Pedestals_sum
private

Definition at line 65 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().

◆ SiPixelGainCalibrationService_

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

Definition at line 60 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze(), and SiPixelCondObjAllPayloadsReader().

◆ tkGeomToken_

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

Definition at line 59 of file SiPixelCondObjAllPayloadsReader.cc.

Referenced by analyze().