27 : showEmCands(iConfig.getUntrackedParameter<
bool>(
"showEmCands")),
28 showRegionSums(iConfig.getUntrackedParameter<
bool>(
"showRegionSums")),
29 ecalDigisLabel(iConfig.getParameter<
edm::InputTag>(
"ecalDigisLabel")),
30 hcalDigisLabel(iConfig.getParameter<
edm::InputTag>(
"hcalDigisLabel")),
31 rctDigisLabel(iConfig.getParameter<
edm::InputTag>(
"rctDigisLabel")) {
36 emTree = fs->
make<TTree>(
"emTree",
"L1 RCT EM tree");
46 h_emRank = fs->
make<TH1F>(
"emRank",
"emRank", 64, 0., 64.);
48 fs->
make<TH1F>(
"emRankOutOfTime",
"emRankOutOfTime", 64, 0., 64.);
49 h_emIeta = fs->
make<TH1F>(
"emIeta",
"emIeta", 22, 0., 22.);
50 h_emIphi = fs->
make<TH1F>(
"emIphi",
"emIphi", 18, 0., 18.);
51 h_emIso = fs->
make<TH1F>(
"emIso",
"emIso", 2, 0., 2.);
53 fs->
make<TH2F>(
"emRank2D",
"emRank2D", 22, 0., 22., 18, 0., 18.);
55 fs->
make<TH2F>(
"emIso2D",
"emIso2D", 22, 0., 22., 18, 0., 18.);
57 fs->
make<TH2F>(
"emNonIso2D",
"emNonIso2D", 22, 0., 22., 18, 0., 18.);
59 fs->
make<TH1F>(
"emCandTimeSample",
"emCandTimeSample", 5, -2., 2.);
66 fs->
make<TH2F>(
"regionSum2D",
"regionSum2D", 22, 0., 22., 18, 0., 18.);
68 fs->
make<TH2F>(
"regionFG2D",
"regionFG2D", 22, 0., 22., 18, 0., 18.);
73 fs->
make<TH1F>(
"ecalTimeSample",
"ecalTimeSample", 10, 0., 10.);
75 fs->
make<TH1F>(
"hcalTimeSample",
"hcalTimeSample", 10, 0., 10.);
94 #ifdef THIS_IS_AN_EVENT_EXAMPLE 99 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 101 iSetup.
get<SetupRecord>().
get(pSetup);
110 L1CaloEmCollection::const_iterator em;
111 L1CaloRegionCollection::const_iterator rgn;
123 for (ecal = ecalColl->
begin(); ecal != ecalColl->
end(); ecal++) {
129 for (hcal = hcalColl->
begin(); hcal != hcalColl->
end(); hcal++) {
139 for (em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
143 (*myL1EmColl).push_back(*myL1EmCand);
147 if ((*em).bx() == 0) {
148 unsigned short n_emcands = 0;
151 if ((*em).rank() > 0) {
153 h_emIeta->Fill((*em).regionId().ieta());
154 h_emIphi->Fill((*em).regionId().iphi());
155 h_emIso->Fill((*em).isolated());
157 (*em).regionId().iphi(), (*em).rank());
158 if ((*em).isolated()) {
160 (*em).regionId().iphi());
163 (*em).regionId().iphi());
168 if ((*em).rank() > 0) {
170 unsigned short rgnPhi = 999;
171 unsigned short rgn = (
unsigned short)(*em).rctRegion();
172 unsigned short card = (
unsigned short)(*em).rctCard();
173 unsigned short crate = (
unsigned short)(*em).rctCrate();
177 }
else if (card < 6) {
180 std::cout <<
"rgnPhi not assigned (still " << rgnPhi
181 <<
") -- Weird card number! " << card;
185 short eta_bin = (card / 2) * 2 + 1;
187 eta_bin = eta_bin + rgn;
213 for (em = myL1EmColl->begin(); em != myL1EmColl->end(); em++) {
214 emRank.push_back((*em).rank());
215 emIeta.push_back((*em).regionId().ieta());
216 emIphi.push_back((*em).regionId().iphi());
217 emIso.push_back((*em).isolated());
224 for (rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
225 if ((*rgn).bx() == 0) {
229 if ((*rgn).et() > 0) {
255 return (cand1.
rank() < cand2.
rank());
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< int > emIeta
std::vector< L1CaloEmCand > L1CaloEmCollection
TH2F * h_regionSumInIetaIphi
static bool compareEmCands(const L1CaloEmCand &cand1, const L1CaloEmCand &cand2)
std::vector< T >::const_iterator const_iterator
Level-1 Region Calorimeter Trigger EM candidate.
T * make(const Args &...args) const
make new ROOT object
TH2F * h_emRankInIetaIphi
TH1F * h_emCandTimeSample
TH2F * h_emNonIsoInIetaIphi
~L1RCTTestAnalyzer() override
std::vector< int > emRank
unsigned rank() const
get rank bits
edm::InputTag rctDigisLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
L1RCTTestAnalyzer(const edm::ParameterSet &)
edm::InputTag hcalDigisLabel
const_iterator end() const
TH2F * h_regionFGInIetaIphi
edm::InputTag ecalDigisLabel
const_iterator begin() const
std::vector< int > emIphi