Skip to content

Commit 6d2f660

Browse files
authored
Merge pull request cms-sw#33349 from CMS-ECAL-Trigger-Group/ecal_double_weight_emulator_11_3_latest
ECAL Emulator Update: Full Configuration Flexibility including L1 Double Weights
2 parents 5980dee + dc1dd85 commit 6d2f660

File tree

59 files changed

+5382
-441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5382
-441
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#ifndef CONDTOOLS_ECAL_ECALTPGODDWEIGHTGROUPHANDLER_H
2+
#define CONDTOOLS_ECAL_ECALTPGODDWEIGHTGROUPHANDLER_H
3+
4+
#include <ctime>
5+
#include <iostream>
6+
#include <map>
7+
#include <string>
8+
#include <typeinfo>
9+
#include <vector>
10+
11+
#include "CondCore/PopCon/interface/PopConSourceHandler.h"
12+
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
13+
14+
#include "FWCore/ServiceRegistry/interface/Service.h"
15+
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
16+
#include "FWCore/Framework/interface/ESHandle.h"
17+
#include "FWCore/Framework/interface/Event.h"
18+
#include "FWCore/Framework/interface/MakerMacros.h"
19+
#include "FWCore/MessageLogger/interface/MessageLogger.h"
20+
#include "FWCore/ParameterSet/interface/ParameterSet.h"
21+
#include "DataFormats/Common/interface/Handle.h"
22+
#include "FWCore/Framework/interface/EventSetup.h"
23+
#include "FWCore/Framework/interface/EventSetupRecordKey.h"
24+
25+
#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightGroup.h"
26+
#include "CondFormats/DataRecord/interface/EcalTPGOddWeightGroupRcd.h"
27+
28+
#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
29+
#include "OnlineDB/Oracle/interface/Oracle.h"
30+
#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
31+
32+
#include "DataFormats/EcalDetId/interface/EEDetId.h"
33+
#include "DataFormats/EcalDetId/interface/EBDetId.h"
34+
#include "DataFormats/Provenance/interface/Timestamp.h"
35+
36+
class EcalElectronicsMapping;
37+
38+
namespace edm {
39+
class ParameterSet;
40+
class Event;
41+
class EventSetup;
42+
} // namespace edm
43+
44+
namespace popcon {
45+
46+
class EcalTPGOddWeightGroupHandler : public popcon::PopConSourceHandler<EcalTPGOddWeightGroup> {
47+
public:
48+
EcalTPGOddWeightGroupHandler(edm::ParameterSet const&);
49+
~EcalTPGOddWeightGroupHandler() override;
50+
51+
std::map<std::string, int> makeStripId();
52+
53+
void getNewObjects() override;
54+
55+
std::string id() const override { return m_name; }
56+
57+
void readtxtFile();
58+
void readxmlFile();
59+
60+
void readFromFile(const char* inputFile);
61+
void writeFile(const char* inputFile);
62+
63+
EcalCondDBInterface* econn;
64+
65+
private:
66+
std::string to_string(char value[]) {
67+
std::ostringstream streamOut;
68+
streamOut << value;
69+
return streamOut.str();
70+
}
71+
72+
unsigned int m_firstRun;
73+
unsigned int m_lastRun;
74+
75+
std::map<std::string, int> correspId;
76+
77+
const EcalElectronicsMapping* ecalMapping_;
78+
std::string m_location;
79+
std::string m_gentag;
80+
std::string m_sid;
81+
std::string m_user;
82+
std::string m_pass;
83+
std::string m_locationsource;
84+
std::string m_name;
85+
unsigned int m_runnr;
86+
std::string m_runtype;
87+
std::string m_i_tag;
88+
std::string m_file_type;
89+
std::string m_file_name;
90+
int m_i_version;
91+
unsigned int m_i_run_number;
92+
int m_i_oddweightGroup;
93+
};
94+
} // namespace popcon
95+
#endif
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#ifndef CONDTOOLS_ECAL_ECALTPGODDWEIGHTIDMAPHANDLER_H
2+
#define CONDTOOLS_ECAL_ECALTPGODDWEIGHTIDMAPHANDLER_H
3+
4+
#include <ctime>
5+
#include <iostream>
6+
#include <map>
7+
#include <string>
8+
#include <typeinfo>
9+
#include <vector>
10+
11+
#include "CondCore/PopCon/interface/PopConSourceHandler.h"
12+
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
13+
14+
#include "FWCore/ServiceRegistry/interface/Service.h"
15+
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
16+
#include "FWCore/Framework/interface/ESHandle.h"
17+
#include "FWCore/Framework/interface/Event.h"
18+
#include "FWCore/Framework/interface/MakerMacros.h"
19+
#include "FWCore/MessageLogger/interface/MessageLogger.h"
20+
#include "FWCore/ParameterSet/interface/ParameterSet.h"
21+
#include "DataFormats/Common/interface/Handle.h"
22+
#include "FWCore/Framework/interface/EventSetup.h"
23+
#include "FWCore/Framework/interface/EventSetupRecordKey.h"
24+
25+
#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightIdMap.h"
26+
#include "CondFormats/DataRecord/interface/EcalTPGOddWeightIdMapRcd.h"
27+
28+
#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
29+
#include "OnlineDB/Oracle/interface/Oracle.h"
30+
#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
31+
32+
#include "DataFormats/EcalDetId/interface/EEDetId.h"
33+
#include "DataFormats/EcalDetId/interface/EBDetId.h"
34+
#include "DataFormats/Provenance/interface/Timestamp.h"
35+
36+
namespace edm {
37+
class ParameterSet;
38+
class Event;
39+
class EventSetup;
40+
} // namespace edm
41+
42+
namespace popcon {
43+
44+
class EcalTPGOddWeightIdMapHandler : public popcon::PopConSourceHandler<EcalTPGOddWeightIdMap> {
45+
public:
46+
EcalTPGOddWeightIdMapHandler(edm::ParameterSet const&);
47+
~EcalTPGOddWeightIdMapHandler() override;
48+
49+
void getNewObjects() override;
50+
51+
std::string id() const override { return m_name; }
52+
53+
void readtxtFile();
54+
void readxmlFile();
55+
56+
void readFromFile(const char* inputFile);
57+
void writeFile(const char* inputFile);
58+
59+
EcalCondDBInterface* econn;
60+
61+
private:
62+
std::string to_string(char value[]) {
63+
std::ostringstream streamOut;
64+
streamOut << value;
65+
return streamOut.str();
66+
}
67+
68+
const EcalTPGOddWeightIdMap* myweightIdMap;
69+
70+
unsigned int m_firstRun;
71+
unsigned int m_lastRun;
72+
73+
std::string m_location;
74+
std::string m_gentag;
75+
std::string m_sid;
76+
std::string m_user;
77+
std::string m_pass;
78+
std::string m_locationsource;
79+
std::string m_name;
80+
unsigned int m_runnr;
81+
std::string m_runtype;
82+
std::string m_i_tag;
83+
std::string m_file_type;
84+
std::string m_file_name;
85+
int m_i_version;
86+
unsigned int m_i_run_number;
87+
int m_i_oddweightIdMap;
88+
};
89+
} // namespace popcon
90+
#endif
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#ifndef CONDTOOLS_ECAL_ECALTPGTPMODEHANDLER_H
2+
#define CONDTOOLS_ECAL_ECALTPGTPMODEHANDLER_H
3+
4+
#include <vector>
5+
#include <typeinfo>
6+
#include <string>
7+
#include <map>
8+
#include <iostream>
9+
#include <ctime>
10+
11+
#include "CondCore/PopCon/interface/PopConSourceHandler.h"
12+
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
13+
14+
#include "FWCore/ServiceRegistry/interface/Service.h"
15+
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
16+
#include "FWCore/Framework/interface/ESHandle.h"
17+
#include "FWCore/Framework/interface/Event.h"
18+
#include "FWCore/Framework/interface/MakerMacros.h"
19+
#include "FWCore/MessageLogger/interface/MessageLogger.h"
20+
#include "FWCore/ParameterSet/interface/ParameterSet.h"
21+
#include "DataFormats/Common/interface/Handle.h"
22+
#include "FWCore/Framework/interface/EventSetup.h"
23+
#include "FWCore/Framework/interface/EventSetupRecordKey.h"
24+
25+
#include "CondFormats/EcalObjects/interface/EcalTPGTPMode.h"
26+
#include "CondFormats/DataRecord/interface/EcalTPGTPModeRcd.h"
27+
28+
#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
29+
#include "OnlineDB/Oracle/interface/Oracle.h"
30+
#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
31+
32+
#include "DataFormats/Provenance/interface/Timestamp.h"
33+
34+
class EcalElectronicsMapping;
35+
36+
namespace edm {
37+
class ParameterSet;
38+
class Event;
39+
class EventSetup;
40+
} // namespace edm
41+
42+
namespace popcon {
43+
44+
class EcalTPGTPModeHandler : public popcon::PopConSourceHandler<EcalTPGTPMode> {
45+
public:
46+
EcalTPGTPModeHandler(edm::ParameterSet const&);
47+
~EcalTPGTPModeHandler() override;
48+
49+
void getNewObjects() override;
50+
51+
std::string id() const override { return m_name; }
52+
53+
void readtxtFile();
54+
// void readxmlFile();
55+
56+
void readFromFile(const char* inputFile);
57+
void writeFile(const char* inputFile);
58+
59+
EcalCondDBInterface* econn;
60+
61+
private:
62+
std::string to_string(char value[]) {
63+
std::ostringstream streamOut;
64+
streamOut << value;
65+
return streamOut.str();
66+
}
67+
68+
unsigned int m_firstRun;
69+
unsigned int m_lastRun;
70+
71+
std::string m_location;
72+
std::string m_gentag;
73+
std::string m_sid;
74+
std::string m_user;
75+
std::string m_pass;
76+
std::string m_locationsource;
77+
std::string m_name;
78+
unsigned int m_runnr;
79+
std::string m_runtype;
80+
std::string m_i_tag;
81+
std::string m_file_type;
82+
std::string m_file_name;
83+
int m_i_version;
84+
unsigned int m_i_run_number;
85+
int m_i_TPMode;
86+
};
87+
} // namespace popcon
88+
#endif
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import FWCore.ParameterSet.Config as cms
2+
import CondTools.Ecal.conddb_init as conddb_init
3+
import CondTools.Ecal.db_credentials as auth
4+
5+
process = cms.Process("ProcessOne")
6+
7+
process.MessageLogger = cms.Service("MessageLogger",
8+
debugModules = cms.untracked.vstring('*'),
9+
cout = cms.untracked.PSet(
10+
threshold = cms.untracked.string('DEBUG')
11+
),
12+
destinations = cms.untracked.vstring('cout')
13+
)
14+
15+
16+
process.source = cms.Source("EmptyIOVSource",
17+
lastValue = cms.uint64(100000000),
18+
timetype = cms.string('runnumber'),
19+
firstValue = cms.uint64(100000000),
20+
interval = cms.uint64(1)
21+
)
22+
23+
process.load("CondCore.CondDB.CondDB_cfi")
24+
25+
process.CondDB.connect = conddb_init.options.destinationDatabase
26+
process.CondDB.DBParameters.authenticationPath = ''
27+
28+
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
29+
process.CondDB,
30+
toPut = cms.VPSet(cms.PSet(
31+
record = cms.string('EcalTPGTPModeRcd'),
32+
tag = cms.string(conddb_init.options.destinationTag)
33+
))
34+
)
35+
36+
db_reader_account = 'CMS_ECAL_R'
37+
db_service,db_user,db_pwd = auth.get_db_credentials( db_reader_account )
38+
39+
process.Test1 = cms.EDAnalyzer("ExTestEcalTPGTPModeAnalyzer",
40+
record = cms.string('EcalTPGTPModeRcd'),
41+
loggingOn= cms.untracked.bool(True),
42+
IsDestDbCheckedInQueryLog=cms.untracked.bool(True),
43+
SinceAppendMode=cms.bool(True),
44+
Source=cms.PSet(
45+
firstRun = cms.string('340400'),
46+
lastRun = cms.string('10000000'),
47+
OnlineDBSID = cms.string(db_service),
48+
OnlineDBUser = cms.string(db_user),
49+
OnlineDBPassword = cms.string( db_pwd ),
50+
LocationSource = cms.string('P5'),
51+
Location = cms.string('P5_Co'),
52+
GenTag = cms.string('GLOBAL'),
53+
RunType = cms.string('PHYSICS'),
54+
fileType = cms.string(''),
55+
fileName = cms.string('')
56+
)
57+
)
58+
59+
process.p = cms.Path(process.Test1)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import FWCore.ParameterSet.Config as cms
2+
import CondTools.Ecal.conddb_init as conddb_init
3+
import CondTools.Ecal.db_credentials as auth
4+
5+
process = cms.Process("ProcessOne")
6+
7+
process.MessageLogger = cms.Service("MessageLogger",
8+
debugModules = cms.untracked.vstring('*'),
9+
cout = cms.untracked.PSet(
10+
threshold = cms.untracked.string('DEBUG')
11+
),
12+
destinations = cms.untracked.vstring('cout')
13+
)
14+
15+
16+
process.source = cms.Source("EmptyIOVSource",
17+
lastValue = cms.uint64(100000000),
18+
timetype = cms.string('runnumber'),
19+
firstValue = cms.uint64(100000000),
20+
interval = cms.uint64(1)
21+
)
22+
23+
process.load("CondCore.CondDB.CondDB_cfi")
24+
25+
process.CondDB.connect = conddb_init.options.destinationDatabase
26+
process.CondDB.DBParameters.authenticationPath = ''
27+
28+
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
29+
process.CondDB,
30+
toPut = cms.VPSet(cms.PSet(
31+
record = cms.string('EcalTPGOddWeightGroupRcd'),
32+
tag = cms.string(conddb_init.options.destinationTag)
33+
))
34+
)
35+
36+
db_reader_account = 'CMS_ECAL_R'
37+
db_service,db_user,db_pwd = auth.get_db_credentials( db_reader_account )
38+
39+
process.Test1 = cms.EDAnalyzer("ExTestEcalTPGOddWeightGroupAnalyzer",
40+
record = cms.string('EcalTPGOddWeightGroupRcd'),
41+
loggingOn= cms.untracked.bool(True),
42+
IsDestDbCheckedInQueryLog=cms.untracked.bool(True),
43+
SinceAppendMode=cms.bool(True),
44+
Source=cms.PSet(
45+
firstRun = cms.string('340400'),
46+
lastRun = cms.string('10000000'),
47+
OnlineDBSID = cms.string(db_service),
48+
OnlineDBUser = cms.string(db_user),
49+
OnlineDBPassword = cms.string( db_pwd ),
50+
LocationSource = cms.string('P5'),
51+
Location = cms.string('P5_Co'),
52+
GenTag = cms.string('GLOBAL'),
53+
RunType = cms.string('PHYSICS'),
54+
fileType = cms.string(''),
55+
fileName = cms.string('')
56+
)
57+
)
58+
59+
process.p = cms.Path(process.Test1)

0 commit comments

Comments
 (0)