73 (
"wenuCollectionTag");
96 if (not usePrecalcID_) {
98 if (useConversionRejection_)
std::cout <<
"WenuPlots: Warning: you have demanded egamma conversion rejection criteria to be applied" << std::endl;
99 if (useExpectedMissingHits_)
std::cout <<
"WenuPlots: Warning: you have demanded at most "
100 <<maxNumberOfExpectedMissingHits_ <<
" missing inner hits "<< std::endl;
119 (
"PrimaryVerticesCollection",
edm::InputTag(
"offlinePrimaryVertices"));
121 (
"PrimaryVerticesCollectionBS",
edm::InputTag(
"offlinePrimaryVerticesWithBS"));
214 if (not WenuCands.isValid()) {
215 cout <<
"Warning: no wenu candidates in this event..." << endl;
219 const pat::CompositeCandidateCollection::const_iterator
220 wenuIter = wcands->begin();
225 dynamic_cast<const pat::Electron*
> (wenu.daughter(
"electron"));
227 dynamic_cast<const pat::MET*
> (wenu.daughter(
"met"));
229 dynamic_cast<const pat::MET*
> (wenu.daughter(
"pfmet"));
231 dynamic_cast<const pat::MET*
> (wenu.daughter(
"tcmet"));
248 ele_sc_eta = (Float_t) myElec->superCluster()->eta();
249 ele_sc_phi = (Float_t) myElec->superCluster()->phi();
250 double scx = myElec->superCluster()->x();
251 double scy = myElec->superCluster()->y();
252 double scz = myElec->superCluster()->z();
255 ele_sc_gsf_et = (Float_t) myElec->superCluster()->energy()/TMath::CosH(myElec->gsfTrack()->eta());
262 ele_iso_hcal = (Float_t) ( myElec->dr03IsolationVariables().hcalDepth1TowerSumEt +
263 myElec->dr03IsolationVariables().hcalDepth2TowerSumEt) /
ele_cand_et;
266 ele_id_deta = (Float_t) myElec->deltaEtaSuperClusterTrackAtVtx();
267 ele_id_dphi = (Float_t) myElec->deltaPhiSuperClusterTrackAtVtx();
268 ele_id_hoe = (Float_t) myElec->hadronicOverEm();
270 ele_cr_mhitsinner= myElec->gsfTrack()->trackerExpectedHitsInner().numberOfHits();
274 ele_vx = (Float_t) myElec->vx();
275 ele_vy = (Float_t) myElec->vy();
276 ele_vz = (Float_t) myElec->vz();
281 const std::vector<reco::Vertex> Vtx = *(pVtx.product());
285 const std::vector<reco::Vertex> VtxBS = *(pVtxBS.product());
286 if (Vtx.size() > 0) {
297 if (VtxBS.size() > 0) {
312 ele_ctfCharge = (Int_t) myElec->closestCtfTrackRef().isNonnull() ? myElec->closestCtfTrackRef()->charge():-9999;
314 ele_eop = (Float_t) myElec->eSuperClusterOverP();
317 ele_pin = (Float_t) myElec->trackMomentumAtVtx().R();
318 ele_pout = (Float_t) myElec->trackMomentumOut().R();
347 for (
int i=0;
i<5; ++
i) {
360 int nCaloJets = (int) caloJets->size();
362 float *nCaloET =
new float[nCaloJets];
363 float *nCaloEta =
new float[nCaloJets];
364 float *nCaloPhi =
new float[nCaloJets];
365 reco::CaloJetCollection::const_iterator cjet = caloJets->begin();
367 for (; cjet != caloJets->end(); ++cjet) {
372 nCaloEta[
counter] = cjet->eta();
373 nCaloPhi[
counter] = cjet->phi();
377 int *caloJetSorted =
new int[nCaloJets];
378 TMath::Sort(nCaloJets, nCaloET, caloJetSorted,
true);
379 for (
int i=0;
i<nCaloJets; ++
i) {
385 delete [] caloJetSorted;
391 std::cout <<
"WenuPlots: Could not get caloJet collection with name "
398 int nPfJets = (int) pfJets->size();
400 float *nPfET =
new float[nPfJets];
401 float *nPfEta =
new float[nPfJets];
402 float *nPfPhi =
new float[nPfJets];
403 reco::PFJetCollection::const_iterator pjet = pfJets->begin();
405 for (; pjet != pfJets->end(); ++pjet) {
415 int *pfJetSorted =
new int[nPfJets];
416 TMath::Sort(nPfJets, nPfET, pfJetSorted,
true);
417 for (
int i=0;
i<nPfJets; ++
i) {
423 delete [] pfJetSorted;
429 std::cout <<
"WenuPlots: Could not get pfJet collection with name "
485 dynamic_cast<const pat::Electron*
> (wenu.daughter(
"secondElec"));
539 if (Vtx.size() > 0) {
542 if (VtxBS.size() > 0) {
556 if (myElec->hasUserFloat(
"HLTMatchingDR")) {
559 if (myElec->hasUserInt(
"triggerDecision")) {
563 for (Int_t
i=0;
i < (Int_t) Vtx.size(); ++
i) {
567 for (Int_t
i=0;
i < (Int_t) VtxBS.size(); ++
i) {
575 if (
CheckCuts(myElec) && myElec->userInt(
"failsSecondElectronCut") == 0) {
594 Double_t scEta = myElec->superCluster()->eta();
595 Double_t scPhi = myElec->superCluster()->phi();
596 Double_t scEt = myElec->superCluster()->energy()/TMath::CosH(scEta);
597 Double_t
met = myMet->et();
598 Double_t metPhi = myMet->phi();
599 Double_t mt = TMath::Sqrt(2.0*scEt*
met*(1.0-(TMath::Cos(scPhi)*TMath::Cos(metPhi)+TMath::Sin(scPhi)*TMath::Sin(metPhi))));
604 Double_t sihih = myElec->scSigmaIEtaIEta();
605 Double_t dphi = myElec->deltaPhiSuperClusterTrackAtVtx();
606 Double_t deta = myElec->deltaEtaSuperClusterTrackAtVtx();
607 Double_t HoE = myElec->hadronicOverEm();
618 if(TMath::Abs(scEta)<1.479){
622 if(TMath::Abs(scEta)>1.479){
634 if (not usePrecalcID_) {
635 if ( TMath::Abs(scEta) < 1.479) {
654 if(TMath::Abs(scEta)<1.479){
667 if(TMath::Abs(scEta)>1.479){
727 std::cout <<
"Error! not existing ID with name: "
765 if (
CheckCut(ele,
i) ==
false)
return false;
771 Double_t fabseta = TMath::Abs(ele->
superCluster()->eta());
772 if ( fabseta<1.479) {
779 Double_t fabseta = TMath::Abs(ele->
superCluster()->eta());
780 if ( fabseta<1.479) {
809 else if (i==8)
return fabs(ele->
dB());
814 std::cout <<
"Error in WenuPlots::ReturnCandVar" << std::endl;
820 Bool_t passConvRej =
true;
821 Bool_t passPXB =
true;
822 Bool_t passEMH =
true;
824 if (ele->
hasUserInt(
"PassConversionRejection")) {
826 if (not (ele->
userInt(
"PassConversionRejection")==1)) passConvRej =
false;
829 std::cout <<
"WenuPlots: WARNING: Conversion Rejection Request Disregarded: "
830 <<
"you must calculate it before " << std::endl;
835 if (ele->
hasUserInt(
"PassValidFirstPXBHit")) {
837 if (not (ele->
userInt(
"PassValidFirstPXBHit")==1)) passPXB =
false;
840 std::cout <<
"WenuPlots: WARNING: Valid First PXB Hit Request Disregarded: "
841 <<
"you must calculate it before " << std::endl;
846 if (ele->
hasUserInt(
"NumberOfExpectedMissingHits")) {
852 std::cout <<
"WenuPlots: WARNING: Number of Expected Missing Hits Request Disregarded: "
853 <<
"you must calculate it before " << std::endl;
857 return passConvRej && passPXB && passEMH;
868 h_met =
new TH1F(
"h_met",
"h_met", 200, 0, 200);
869 h_met_inverse =
new TH1F(
"h_met_inverse",
"h_met_inverse", 200, 0, 200);
871 h_mt =
new TH1F(
"h_mt",
"h_mt", 200, 0, 200);
872 h_mt_inverse =
new TH1F(
"h_mt_inverse",
"h_mt_inverse", 200, 0, 200);
875 h_met_EB =
new TH1F(
"h_met_EB",
"h_met_EB", 200, 0, 200);
876 h_met_inverse_EB =
new TH1F(
"h_met_inverse_EB",
"h_met_inverse_EB", 200, 0, 200);
878 h_mt_EB =
new TH1F(
"h_mt_EB",
"h_mt_EB", 200, 0, 200);
879 h_mt_inverse_EB =
new TH1F(
"h_mt_inverse_EB",
"h_mt_inverse_EB", 200, 0, 200);
882 h_met_EE =
new TH1F(
"h_met_EE",
"h_met_EE", 200, 0, 200);
883 h_met_inverse_EE =
new TH1F(
"h_met_inverse_EE",
"h_met_inverse_EE", 200, 0, 200);
885 h_mt_EE =
new TH1F(
"h_mt_EE",
"h_mt_EE", 200, 0, 200);
886 h_mt_inverse_EE =
new TH1F(
"h_mt_inverse_EE",
"h_mt_inverse_EE", 200, 0, 200);
889 h_scEt =
new TH1F(
"h_scEt",
"h_scEt", 200, 0, 100);
890 h_scEta =
new TH1F(
"h_scEta",
"h_scEta", 200, -3, 3);
891 h_scPhi =
new TH1F(
"h_scPhi",
"h_scPhi", 200, -4, 4);
896 h_EB_trkiso =
new TH1F(
"h_EB_trkiso",
"h_EB_trkiso",200 , 0.0, 9.0);
897 h_EB_ecaliso =
new TH1F(
"h_EB_ecaliso",
"h_EB_ecaliso",200, 0.0 , 9.0);
898 h_EB_hcaliso =
new TH1F(
"h_EB_hcaliso",
"h_EB_hcaliso",200, 0.0 , 9.0);
899 h_EB_sIetaIeta =
new TH1F(
"h_EB_sIetaIeta",
"h_EB_sIetaIeta",200, 0.0 , 0.02 );
900 h_EB_dphi =
new TH1F(
"h_EB_dphi",
"h_EB_dphi",200, -0.03 , 0.03 );
901 h_EB_deta =
new TH1F(
"h_EB_deta",
"h_EB_deta",200, -0.01 , 0.01) ;
902 h_EB_HoE =
new TH1F(
"h_EB_HoE",
"h_EB_HoE",200, 0.0 , 0.2 );
904 h_EE_trkiso =
new TH1F(
"h_EE_trkiso",
"h_EE_trkiso",200 , 0.0, 9.0);
905 h_EE_ecaliso =
new TH1F(
"h_EE_ecaliso",
"h_EE_ecaliso",200, 0.0 , 9.0);
906 h_EE_hcaliso =
new TH1F(
"h_EE_hcaliso",
"h_EE_hcaliso",200, 0.0 , 9.0);
907 h_EE_sIetaIeta =
new TH1F(
"h_EE_sIetaIeta",
"h_EE_sIetaIeta",200, 0.0 , 0.1 );
908 h_EE_dphi =
new TH1F(
"h_EE_dphi",
"h_EE_dphi",200, -0.03 , 0.03 );
909 h_EE_deta =
new TH1F(
"h_EE_deta",
"h_EE_deta",200, -0.01 , 0.01) ;
910 h_EE_HoE =
new TH1F(
"h_EE_HoE",
"h_EE_HoE",200, 0.0 , 0.2 );
916 new TH1F(
"h_trackIso_eb_NmOne",
"trackIso EB N-1 plot",80,0,8);
918 new TH1F(
"h_trackIso_ee_NmOne",
"trackIso EE N-1 plot",80,0,8);
995 "Tree to store the W Candidates that pass the VBTF selection");
1068 "Tree to store the W Candidates that pass the VBTF preselection");
Analysis-level particle class.
Analysis-level MET class.
Double_t trackIsoUser_EB_
T getUntrackedParameter(std::string const &, T const &) const
virtual double et() const GCC11_FINAL
transverse energy
Int_t maxNumberOfExpectedMissingHits_
Bool_t PassPreselectionCriteria(const pat::Electron *ele)
std::string WENU_VBTFselectionFileName_
tuple met
____________________________________________________________________________||
edm::InputTag wenuCollectionTag_
const LorentzVector & p4(P4Kind kind) const
float eSuperClusterOverP() const
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
Double_t trackIsoUser_EE_
#define DEFINE_FWK_MODULE(type)
Int_t ele2nd_passes_selection
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
Float_t event_caloMET_phi
TH1F * h_trackIso_ee_NmOne
math::XYZVectorF trackMomentumAtVtx() const
std::string WENU_VBTFpreseleFileName_
WenuPlots(const edm::ParameterSet &)
edm::LuminosityBlockNumber_t luminosityBlock() const
Bool_t CheckCutInv(const pat::Electron *wenu, Int_t i)
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
Bool_t includeJetInformationInNtuples_
Bool_t hcalIsoUser_EE_inv
float hcalDepth1TowerSumEt
Bool_t CheckCutsInverse(const pat::Electron *ele)
Bool_t CheckCuts(const pat::Electron *ele)
std::vector< Double_t > CutVars_
virtual double vy() const
y coordinate of vertex position
static int position[TOTALCHAMBERS][3]
Bool_t useExpectedMissingHits_
float userFloat(const std::string &key) const
std::string usePrecalcIDSign_
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
bool isNonnull() const
Checks for non-null.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
TFile * WENU_VBTFselectionFile_
Bool_t hcalIsoUser_EB_inv
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
float hadronicOverEm() const
Bool_t ecalIsoUser_EE_inv
Int_t event_triggerDecision
Float_t ele2nd_hltmatched_dr
const T & max(const T &a, const T &b)
edm::InputTag PrimaryVerticesCollectionBS_
math::XYZVectorF trackMomentumOut() const
float deltaPhiSuperClusterTrackAtVtx() const
Float_t ele_hltmatched_dr
Double_t usePrecalcIDValue_
float dr03TkSumPt() const
edm::InputTag caloJetCollectionTag_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< Int_t > VtxTracksSizeBS
Bool_t storeAllSecondElectronVariables_
Bool_t useConversionRejection_
std::vector< Int_t > VtxTracksSize
Double_t ReturnCandVar(const pat::Electron *ele, Int_t i)
TFile * WENU_VBTFpreseleFile_
virtual double vz() const
z coordinate of vertex position
float scSigmaIEtaIEta() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
TH1F * h_trackIso_eb_NmOne
EventAuxiliary const & eventAuxiliary() const
const ChargeInfo & chargeInfo() const
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj)
float userIsolation(IsolationKeys key) const
float hcalDepth2TowerSumEt
std::vector< CompositeCandidate > CompositeCandidateCollection
edm::InputTag PrimaryVerticesCollection_
Bool_t trackIsoUser_EE_inv
int32_t userInt(const std::string &key) const
Bool_t storeExtraInformation_
Analysis-level electron class.
T const * product() const
float dr03EcalRecHitSumEt() const
Bool_t useValidFirstPXBHit_
bool isElectronIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Electron.
edm::InputTag pfJetCollectionTag_
std::string usePrecalcIDType_
Bool_t ecalIsoUser_EB_inv
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Double_t DRJetFromElectron_
const IsolationVariables & dr03IsolationVariables() const
static std::atomic< unsigned int > counter
virtual double vx() const
x coordinate of vertex position
float dr03HcalTowerSumEt() const
Bool_t trackIsoUser_EB_inv
std::vector< Float_t > VtxNormalizedChi2BS
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Int_t ele2nd_cr_mhitsinner
std::vector< Bool_t > InvVars_
EventNumber_t event() const
double dB(IpType type=None) const
Impact parameter wrt primary vertex or beamspot.
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
bool ecalDrivenSeed() const
std::vector< Float_t > VtxNormalizedChi2
Bool_t CheckCut(const pat::Electron *wenu, Int_t i)