CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiPixelLorentzAngleReader (const edm::ParameterSet &)
 
 ~SiPixelLorentzAngleReader () override
 
- 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 * LorentzAngleBarrel_
 
TH1F * LorentzAngleForward_
 
const uint32_t printdebug_
 
const std::string siPixelLALabel_
 
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcdsiPixelLAToken_
 
const std::string siPixelSimLALabel_
 
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcdsiPixelSimLAToken_
 
const bool useSimRcd_
 

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 35 of file SiPixelLorentzAngleReader.cc.

Constructor & Destructor Documentation

◆ SiPixelLorentzAngleReader()

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

Definition at line 56 of file SiPixelLorentzAngleReader.cc.

References TFileService::kSharedResource.

57  : siPixelLAToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("recoLabel")))),
59  printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 10)),
60  useSimRcd_(iConfig.getParameter<bool>("useSimRcd")) {
61  usesResource(TFileService::kSharedResource);
62 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelSimLAToken_
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcd > siPixelLAToken_

◆ ~SiPixelLorentzAngleReader()

SiPixelLorentzAngleReader::~SiPixelLorentzAngleReader ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiPixelLorentzAngleReader::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 66 of file SiPixelLorentzAngleReader.cc.

References submitPVResolutionJobs::count, compareTotals::fs, edm::EventSetup::getData(), SiPixelLorentzAngle::getLorentzAngles(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LorentzAngleBarrel_, LorentzAngleForward_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, printdebug_, siPixelLAToken_, siPixelSimLAToken_, DetId::subdetId(), and useSimRcd_.

66  {
67  const SiPixelLorentzAngle* SiPixelLorentzAngle_;
68  if (useSimRcd_) {
69  SiPixelLorentzAngle_ = &iSetup.getData(siPixelSimLAToken_);
70  } else {
71  SiPixelLorentzAngle_ = &iSetup.getData(siPixelLAToken_);
72  }
73 
74  edm::LogInfo("SiPixelLorentzAngleReader")
75  << "[SiPixelLorentzAngleReader::analyze] End Reading SiPixelLorentzAngle" << std::endl;
77  LorentzAngleBarrel_ = fs->make<TH1F>("LorentzAngleBarrelPixel", "LorentzAngleBarrelPixel", 150, 0, 0.15);
78  LorentzAngleForward_ = fs->make<TH1F>("LorentzAngleForwardPixel", "LorentzAngleForwardPixel", 150, 0, 0.15);
79  std::map<unsigned int, float> detid_la = SiPixelLorentzAngle_->getLorentzAngles();
80  std::map<unsigned int, float>::const_iterator it;
81  unsigned int count = 0;
82  for (it = detid_la.begin(); it != detid_la.end(); it++) {
83  count++;
84  if (count <= printdebug_) {
85  edm::LogPrint("SiPixelLorentzAngleReader") << "detid " << it->first << " \t"
86  << " Lorentz angle " << it->second << std::endl;
87  }
88  unsigned int subdet = DetId(it->first).subdetId();
89  if (subdet == static_cast<int>(PixelSubdetector::PixelBarrel)) {
90  LorentzAngleBarrel_->Fill(it->second);
91  } else if (subdet == static_cast<int>(PixelSubdetector::PixelEndcap)) {
92  LorentzAngleForward_->Fill(it->second);
93  }
94  }
95  edm::LogPrint("SiPixelLorentzAngleReader")
96  << "SiPixelLorentzAngleReader::" << __FUNCTION__ << "(...) :examined " << count << " DetIds" << std::endl;
97 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const std::map< unsigned int, float > & getLorentzAngles() const
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelSimLAToken_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
Definition: DetId.h:17
const edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcd > siPixelLAToken_

◆ fillDescriptions()

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

Definition at line 99 of file SiPixelLorentzAngleReader.cc.

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

99  {
101  desc.setComment("EDAnalyzer to read per-module SiPixelLorentzAngle payloads in the EventSetup");
102  desc.add<std::string>("recoLabel", "")->setComment("label for the reconstruction tags");
103  desc.add<std::string>("simLabel", "")->setComment("label for the simulation tags");
104  desc.addUntracked<unsigned int>("printDebug", 10);
105  desc.add<bool>("useSimRcd", false);
106  descriptions.addWithDefaultLabel(desc);
107 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ LorentzAngleBarrel_

TH1F* SiPixelLorentzAngleReader::LorentzAngleBarrel_
private

Definition at line 50 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().

◆ LorentzAngleForward_

TH1F* SiPixelLorentzAngleReader::LorentzAngleForward_
private

Definition at line 51 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().

◆ printdebug_

const uint32_t SiPixelLorentzAngleReader::printdebug_
private

Definition at line 48 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().

◆ siPixelLALabel_

const std::string SiPixelLorentzAngleReader::siPixelLALabel_
private

Definition at line 46 of file SiPixelLorentzAngleReader.cc.

◆ siPixelLAToken_

const edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleRcd> SiPixelLorentzAngleReader::siPixelLAToken_
private

Definition at line 44 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().

◆ siPixelSimLALabel_

const std::string SiPixelLorentzAngleReader::siPixelSimLALabel_
private

Definition at line 47 of file SiPixelLorentzAngleReader.cc.

◆ siPixelSimLAToken_

const edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd> SiPixelLorentzAngleReader::siPixelSimLAToken_
private

Definition at line 45 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().

◆ useSimRcd_

const bool SiPixelLorentzAngleReader::useSimRcd_
private

Definition at line 49 of file SiPixelLorentzAngleReader.cc.

Referenced by analyze().