CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhysicsPerformanceDBWriterFromFile_WPandPayload Class Reference
Inheritance diagram for PhysicsPerformanceDBWriterFromFile_WPandPayload:
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 (const edm::ParameterSet &)
 
 ~PhysicsPerformanceDBWriterFromFile_WPandPayload () 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
 
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

std::string inputTxtFile
 
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 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 16 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

Constructor & Destructor Documentation

◆ PhysicsPerformanceDBWriterFromFile_WPandPayload()

PhysicsPerformanceDBWriterFromFile_WPandPayload::PhysicsPerformanceDBWriterFromFile_WPandPayload ( const edm::ParameterSet p)

◆ ~PhysicsPerformanceDBWriterFromFile_WPandPayload()

PhysicsPerformanceDBWriterFromFile_WPandPayload::~PhysicsPerformanceDBWriterFromFile_WPandPayload ( )
inlineoverride

Definition at line 22 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

22 {}

Member Function Documentation

◆ analyze()

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

◆ beginJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob ( void  )
overridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 36 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

References newFWLiteAna::bin, PA_MinBiasSkim_cff::cut, beamvalidation::exit(), recoMuon::in, inputTxtFile, contentValuesFiles::number, rec1, rec2, alignCSCRings::s, gpuPixelDoublets::stride, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, createJobs::tmp, and pfClustersFromHGC3DClusters_cfi::wp.

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

◆ endJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 21 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

21 {}

Member Data Documentation

◆ inputTxtFile

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload::inputTxtFile
private

◆ rec1

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload::rec1
private

◆ rec2

std::string PhysicsPerformanceDBWriterFromFile_WPandPayload::rec2
private