CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhysicsPerformanceDBWriterFromFile_WPandPayload Class Reference
Inheritance diagram for PhysicsPerformanceDBWriterFromFile_WPandPayload:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 PhysicsPerformanceDBWriterFromFile_WPandPayload (const edm::ParameterSet &)
 
 ~PhysicsPerformanceDBWriterFromFile_WPandPayload () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 16 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

Constructor & Destructor Documentation

◆ PhysicsPerformanceDBWriterFromFile_WPandPayload()

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

Definition at line 29 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

30  {
31  inputTxtFile = p.getUntrackedParameter<std::string>("inputTxtFile");
32  rec1 = p.getUntrackedParameter<std::string>("RecordPayload");
33  rec2 = p.getUntrackedParameter<std::string>("RecordWP");
34 }

References inputTxtFile, AlCaHLTBitMon_ParallelJobs::p, rec1, rec2, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~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 ( const edm::Event ,
const edm::EventSetup  
)
inlineoverridevirtual

Implements edm::EDAnalyzer.

Definition at line 20 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

20 {}

◆ beginJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob ( void  )
overridevirtual

JUST A STUPID PATCH

Reimplemented from edm::EDAnalyzer.

Definition at line 36 of file PhysicsPerformanceDBWriterFromFile_WPandPayload.cc.

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  std::cout << "Opening " << inputTxtFile << std::endl;
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  std::cout << "WP Tagger is " << tagger << std::endl;
64 
65  in >> cut;
66  std::cout << "WP Cut is " << cut << std::endl;
67 
68  in >> concreteType;
69  std::cout << "concrete Type is " << concreteType << std::endl;
70 
71  // return ;
72 
73  // read # of results
74 
75  int nres, nbin;
76  in >> nres;
77  in >> nbin;
78  std::cout << " Results: " << nres << " Binning variables: " << nbin << std::endl;
79 
80  stride = nres + nbin * 2;
81  if (!stride) {
82  std::cout << " Malformed input file" << std::endl;
83  exit(1);
84  }
85 
86  int number = 0;
87 
88  std::vector<PerformanceResult::ResultType> res;
89  std::vector<BinningVariables::BinningVariablesType> bin;
90 
91  while (number < nres && !in.eof()) {
92  int tmp;
93  in >> tmp;
95  number++;
96  }
97  if (number != nres) {
98  std::cout << " Table not well formed" << std::endl;
99  }
100  number = 0;
101  while (number < nbin && !in.eof()) {
102  int tmp;
103  in >> tmp;
105  number++;
106  }
107  if (number != nbin) {
108  std::cout << " Table not well formed" << std::endl;
109  }
110 
111  number = 0;
112  while (!in.eof()) {
113  float temp;
114  in >> temp;
115  std::cout << " Intersing " << temp << " in position " << number << std::endl;
116  number++;
117  pl.push_back(temp);
118  }
119 
120  //
121  // CHECKS
122  //
123  if (stride != nbin * 2 + nres) {
124  std::cout << " Table not well formed" << std::endl;
125  }
126  if ((number % stride) != 0) {
127  std::cout << " Table not well formed" << std::endl;
128  }
129 
130  std::cout << " CLOSING " << std::endl;
131  in.close();
132 
133  /* for (int k=0;k<(number/stride); k++){
134  for (int j=0; j<stride; j++){
135  std::cout << "Pos["<<k<<","<<j<<"] = "<<pl[k*stride+j]<<std::endl;
136  }
137  }
138  */
139 
140  //
141  // now create pl etc etc
142  //
143 
145 
146  PerformancePayloadFromTable* btagpl = nullptr;
147 
148  if (concreteType == "PerformancePayloadFromTable") {
149  btagpl = new PerformancePayloadFromTable(res, bin, stride, pl);
150  } else {
151  std::cout << " Non existing request: " << concreteType << std::endl;
152  }
153 
154  std::cout << " Created the " << concreteType << " object" << std::endl;
155 
157  if (s.isAvailable()) {
158  if (s->isNewTagRequest(rec1)) {
159  s->createNewIOV<PerformancePayload>(btagpl, s->beginOfTime(), s->endOfTime(), rec1);
160  } else {
161  s->appendSinceTime<PerformancePayload>(btagpl,
162  // JUST A STUPID PATCH
163  111,
164  rec1);
165  }
166  }
167 
168  // write also the WP
169 
170  if (s.isAvailable()) {
171  if (s->isNewTagRequest(rec2)) {
172  s->createNewIOV<PerformanceWorkingPoint>(wp, s->beginOfTime(), s->endOfTime(), rec2);
173  } else {
174  s->appendSinceTime<PerformanceWorkingPoint>(wp,
176  111,
177  rec2);
178  }
179  }
180 }

References newFWLiteAna::bin, gather_cfg::cout, TkAlMuonSelectors_cfi::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.

◆ endJob()

void PhysicsPerformanceDBWriterFromFile_WPandPayload::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDAnalyzer.

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
PhysicsPerformanceDBWriterFromFile_WPandPayload::inputTxtFile
std::string inputTxtFile
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload.cc:25
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
PerformanceWorkingPoint
Definition: PerformanceWorkingPoint.h:8
pfClustersFromHGC3DClusters_cfi.wp
wp
Definition: pfClustersFromHGC3DClusters_cfi.py:20
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PerformancePayloadFromTable
Definition: PerformancePayloadFromTable.h:15
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
PhysicsPerformanceDBWriterFromFile_WPandPayload::rec2
std::string rec2
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload.cc:26
PerformancePayload
Definition: PerformancePayload.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
recoMuon::in
Definition: RecoMuonEnumerators.h:6
edm::Service< cond::service::PoolDBOutputService >
res
Definition: Electron.h:6
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
BinningVariables::BinningVariablesType
BinningVariablesType
Definition: BinningVariables.h:10
gpuPixelDoublets::stride
auto stride
Definition: gpuPixelDoubletsAlgos.h:80
PhysicsPerformanceDBWriterFromFile_WPandPayload::rec1
std::string rec1
Definition: PhysicsPerformanceDBWriterFromFile_WPandPayload.cc:26