1 |
#include "UserCode/L1RpcTriggerAnalysis/interface/AnaEmu.h"
|
2 |
#include "TObjArray.h"
|
3 |
#include "TH1D.h"
|
4 |
#include "TH1F.h"
|
5 |
#include "TAxis.h"
|
6 |
#include "TGraphErrors.h"
|
7 |
#include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h"
|
8 |
#include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h"
|
9 |
#include "UserCode/L1RpcTriggerAnalysis/interface/L1Obj.h"
|
10 |
#include "UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h"
|
11 |
#include "UserCode/L1RpcTriggerAnalysis/interface/Utilities.h"
|
12 |
#include <sstream>
|
13 |
|
14 |
namespace {
|
15 |
TH1D *hEmu_Muon, *hEmu_Wide, *hEmu_L1Rpc;
|
16 |
}
|
17 |
|
18 |
void AnaEmu::init(TObjArray& histos)
|
19 |
{
|
20 |
hEmu_Muon= new TH1D( "hEmu_Muon", "hEmu_Muon", 64, -1.6, 1.6); histos.Add( hEmu_Muon);
|
21 |
hEmu_Wide= new TH1D( "hEmu_Wide", "hEmu_Wide", 64, -1.6, 1.6); histos.Add( hEmu_Wide);
|
22 |
hEmu_L1Rpc= new TH1D( "hEmu_L1Rpc", "hEmu_L1Rpc", 64, -1.6, 1.6); histos.Add( hEmu_L1Rpc);
|
23 |
}
|
24 |
|
25 |
void AnaEmu::run( const EventObj* event, const MuonObj* muon, const L1ObjColl *l1Coll)
|
26 |
{
|
27 |
if( muon->pt() < 10.) return;
|
28 |
hEmu_Muon->Fill(muon->eta());
|
29 |
L1ObjColl l1RpcColl = l1Coll->l1RpcColl();
|
30 |
std::vector<L1Obj> l1Rpcs = l1RpcColl.selectByMatched().selectByBx().getL1Objs();
|
31 |
L1ObjColl l1RpcCollEmu = l1Coll->l1RpcCollEmu();
|
32 |
std::vector<L1Obj> l1RpcsEmu = l1RpcCollEmu.selectByMatched().selectByBx().getL1Objs();
|
33 |
/*
|
34 |
if (l1RpcsEmu.size()!=0 && l1Rpcs.size()==0 && muon->eta()>-0.25 && muon->eta() < -0.2) {
|
35 |
std::cout<<"--------------"<<std::endl;
|
36 |
debug = true;
|
37 |
std::cout <<"MUON: pt="<<muon->pt()<<" eta="<<muon->eta()<<std::endl;
|
38 |
std::cout <<" HAS EMU, NO TRIGGER matched" << std::endl;
|
39 |
}
|
40 |
*/
|
41 |
if (l1Rpcs.size() > 0) hEmu_L1Rpc->Fill(muon->eta());
|
42 |
if (l1RpcsEmu.size() > 0) hEmu_Wide->Fill(muon->eta());
|
43 |
if (l1Rpcs.size() > 0 && l1RpcsEmu.size()==0) {
|
44 |
// std::cout <<"has no Emu but Rpc, run="<<event->run<<" lumi="<<event->lumi<<std::endl;
|
45 |
// debug = true;
|
46 |
}
|
47 |
if (debug) std::cout <<"MUON: pt="<<muon->pt()<<" eta="<<muon->eta()<<std::endl;
|
48 |
if (debug) {std::cout <<" L1 EMU: "<<std::endl << l1RpcCollEmu;}
|
49 |
if (debug) {std::cout <<" L1 RPC: "<<std::endl << l1RpcColl;}
|
50 |
}
|
51 |
|
52 |
|