CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV Class Reference
Inheritance diagram for PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV:
edm::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::StreamID, const edm::Event &, const edm::EventSetup &) const override
 
void beginJob () override
 
void endJob () override
 
 PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV (const edm::ParameterSet &)
 
 ~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV () override
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () 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)
 

Private Attributes

std::string inputTxtFile
 
unsigned long long iovBegin
 
unsigned long long iovEnd
 
std::string rec1
 
std::string rec2
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::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 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 16 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

Constructor & Destructor Documentation

◆ PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV()

PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV ( const edm::ParameterSet p)

◆ ~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV()

PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::~PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV ( )
inlineoverride

Definition at line 22 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

22 {}

Member Function Documentation

◆ analyze()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::analyze ( edm::StreamID  ,
const edm::Event ,
const edm::EventSetup  
) const
inlineoverridevirtual

◆ beginJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob ( void  )
overridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 39 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

References newFWLiteAna::bin, TkAlMuonSelectors_cfi::cut, recoMuon::in, inputTxtFile, iovBegin, contentValuesFiles::number, rec1, rec2, alignCSCRings::s, riemannFit::stride, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, createJobs::tmp, and pfClustersFromHGC3DClusters_cfi::wp.

39  {
40  //
41  // read object from file
42  //
43 
44  //
45  // File Format is
46  // - tagger name
47  // - cut
48  // - concrete class name
49  // - how many results and how many binning
50  // - their values
51  // - vector<float>
52  //
53 
54  std::ifstream in;
55  in.open(inputTxtFile.c_str());
56  std::string tagger;
57  float cut;
58 
59  std::string concreteType;
60  std::string comment;
61  std::vector<float> pl;
62  int stride;
63 
64  in >> tagger;
65  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << "WP Tagger is " << tagger;
66 
67  in >> cut;
68  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << "WP Cut is " << cut;
69 
70  in >> concreteType;
71  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << "concrete Type is " << concreteType;
72 
73  // return ;
74 
75  // read # of results
76 
77  int nres, nbin;
78  in >> nres;
79  in >> nbin;
80  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV")
81  << " Results: " << nres << " Binning variables: " << nbin;
82 
83  stride = nres + nbin * 2;
84 
85  int number = 0;
86 
87  std::vector<PerformanceResult::ResultType> res;
88  std::vector<BinningVariables::BinningVariablesType> bin;
89 
90  while (number < nres && !in.eof()) {
91  int tmp;
92  in >> tmp;
94  number++;
95  }
96  if (number != nres) {
97  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Table not well formed";
98  }
99  number = 0;
100  while (number < nbin && !in.eof()) {
101  int tmp;
102  in >> tmp;
104  number++;
105  }
106  if (number != nbin) {
107  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Table not well formed";
108  }
109 
110  number = 0;
111  while (!in.eof()) {
112  float temp;
113  in >> temp;
114  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV")
115  << " Inserting " << temp << " in position " << number;
116  number++;
117  pl.push_back(temp);
118  }
119 
120  //
121  // CHECKS
122  //
123  if (stride != nbin * 2 + nres) {
124  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Table not well formed";
125  }
126  if (stride != 0 && (number % stride) != 0) {
127  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Table not well formed";
128  }
129 
130  in.close();
131 
132  /* for (int k=0;k<(number/stride); k++){
133  for (int j=0; j<stride; j++){
134  std::cout << "Pos["<<k<<","<<j<<"] = "<<pl[k*stride+j]<<std::endl;
135  }
136  }
137  */
138 
139  //
140  // now create pl etc etc
141  //
142 
143  PerformanceWorkingPoint wp(cut, tagger);
144 
146 
147  if (concreteType == "PerformancePayloadFromTable") {
148  btagpl = PerformancePayloadFromTable(res, bin, stride, pl);
149  } else {
150  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Non existing request: " << concreteType;
151  }
152 
153  edm::LogInfo("PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV") << " Created the " << concreteType << " object";
154 
156  if (s.isAvailable()) {
157  s->writeOneIOV(btagpl, iovBegin, rec1);
158  // write also the WP
159 
160  s->writeOneIOV(wp, iovBegin, rec2);
161  }
162 }
Definition: Electron.h:6
constexpr uint32_t stride
Definition: HelixFit.h:22
Log< level::Info, false > LogInfo
tmp
align.sh
Definition: createJobs.py:716

◆ endJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 21 of file PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV.cc.

21 {}

Member Data Documentation

◆ inputTxtFile

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::inputTxtFile
private

◆ iovBegin

unsigned long long PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovBegin
private

◆ iovEnd

unsigned long long PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::iovEnd
private

◆ rec1

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec1
private

◆ rec2

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::rec2
private