90 if (not usePrecalcID_) {
92 if (useConversionRejection_)
std::cout <<
"WenuPlots: Warning: you have demanded egamma conversion rejection criteria to be applied" << std::endl;
93 if (useExpectedMissingHits_)
std::cout <<
"WenuPlots: Warning: you have demanded at most "
94 <<maxNumberOfExpectedMissingHits_ <<
" missing inner hits "<< std::endl;
208 if (not WenuCands.isValid()) {
209 cout <<
"Warning: no wenu candidates in this event..." << endl;
213 const pat::CompositeCandidateCollection::const_iterator
214 wenuIter = wcands->begin();
219 dynamic_cast<const pat::Electron*
> (wenu.daughter(
"electron"));
221 dynamic_cast<const pat::MET*
> (wenu.daughter(
"met"));
223 dynamic_cast<const pat::MET*
> (wenu.daughter(
"pfmet"));
225 dynamic_cast<const pat::MET*
> (wenu.daughter(
"tcmet"));
242 ele_sc_eta = (Float_t) myElec->superCluster()->eta();
243 ele_sc_phi = (Float_t) myElec->superCluster()->phi();
244 double scx = myElec->superCluster()->x();
245 double scy = myElec->superCluster()->y();
246 double scz = myElec->superCluster()->z();
249 ele_sc_gsf_et = (Float_t) myElec->superCluster()->energy()/TMath::CosH(myElec->gsfTrack()->eta());
256 ele_iso_hcal = (Float_t) ( myElec->dr03IsolationVariables().hcalDepth1TowerSumEt +
257 myElec->dr03IsolationVariables().hcalDepth2TowerSumEt) /
ele_cand_et;
260 ele_id_deta = (Float_t) myElec->deltaEtaSuperClusterTrackAtVtx();
261 ele_id_dphi = (Float_t) myElec->deltaPhiSuperClusterTrackAtVtx();
262 ele_id_hoe = (Float_t) myElec->hadronicOverEm();
268 ele_vx = (Float_t) myElec->vx();
269 ele_vy = (Float_t) myElec->vy();
270 ele_vz = (Float_t) myElec->vz();
275 const std::vector<reco::Vertex> Vtx = *(pVtx.product());
279 const std::vector<reco::Vertex> VtxBS = *(pVtxBS.product());
280 if (Vtx.size() > 0) {
291 if (VtxBS.size() > 0) {
306 ele_ctfCharge = (Int_t) myElec->closestCtfTrackRef().isNonnull() ? myElec->closestCtfTrackRef()->charge():-9999;
308 ele_eop = (Float_t) myElec->eSuperClusterOverP();
311 ele_pin = (Float_t) myElec->trackMomentumAtVtx().R();
312 ele_pout = (Float_t) myElec->trackMomentumOut().R();
341 for (
int i=0;
i<5; ++
i) {
354 int nCaloJets = (int) caloJets->size();
356 float *nCaloET =
new float[nCaloJets];
357 float *nCaloEta =
new float[nCaloJets];
358 float *nCaloPhi =
new float[nCaloJets];
359 reco::CaloJetCollection::const_iterator cjet = caloJets->begin();
361 for (; cjet != caloJets->end(); ++cjet) {
366 nCaloEta[
counter] = cjet->eta();
367 nCaloPhi[
counter] = cjet->phi();
371 int *caloJetSorted =
new int[nCaloJets];
372 TMath::Sort(nCaloJets, nCaloET, caloJetSorted,
true);
373 for (
int i=0;
i<nCaloJets; ++
i) {
379 delete [] caloJetSorted;
385 std::cout <<
"WenuPlots: Could not get caloJet collection with name "
392 int nPfJets = (int) pfJets->size();
394 float *nPfET =
new float[nPfJets];
395 float *nPfEta =
new float[nPfJets];
396 float *nPfPhi =
new float[nPfJets];
397 reco::PFJetCollection::const_iterator pjet = pfJets->begin();
399 for (; pjet != pfJets->end(); ++pjet) {
409 int *pfJetSorted =
new int[nPfJets];
410 TMath::Sort(nPfJets, nPfET, pfJetSorted,
true);
411 for (
int i=0;
i<nPfJets; ++
i) {
417 delete [] pfJetSorted;
423 std::cout <<
"WenuPlots: Could not get pfJet collection with name "
479 dynamic_cast<const pat::Electron*
> (wenu.daughter(
"secondElec"));
533 if (Vtx.size() > 0) {
536 if (VtxBS.size() > 0) {
550 if (myElec->hasUserFloat(
"HLTMatchingDR")) {
553 if (myElec->hasUserInt(
"triggerDecision")) {
557 for (Int_t
i=0;
i < (Int_t) Vtx.size(); ++
i) {
561 for (Int_t
i=0;
i < (Int_t) VtxBS.size(); ++
i) {
569 if (
CheckCuts(myElec) && myElec->userInt(
"failsSecondElectronCut") == 0) {
588 Double_t scEta = myElec->superCluster()->eta();
589 Double_t scPhi = myElec->superCluster()->phi();
590 Double_t scEt = myElec->superCluster()->energy()/TMath::CosH(scEta);
592 Double_t metPhi =
myMet->phi();
593 Double_t mt = TMath::Sqrt(2.0*scEt*
met*(1.0-(TMath::Cos(scPhi)*TMath::Cos(metPhi)+TMath::Sin(scPhi)*TMath::Sin(metPhi))));
598 Double_t sihih = myElec->scSigmaIEtaIEta();
599 Double_t dphi = myElec->deltaPhiSuperClusterTrackAtVtx();
600 Double_t deta = myElec->deltaEtaSuperClusterTrackAtVtx();
601 Double_t HoE = myElec->hadronicOverEm();
628 if (not usePrecalcID_) {
721 std::cout <<
"Error! not existing ID with name: "
759 if (
CheckCut(ele,
i) ==
false)
return false;
766 if ( fabseta<1.479) {
774 if ( fabseta<1.479) {
803 else if (i==8)
return fabs(ele->
dB());
808 std::cout <<
"Error in WenuPlots::ReturnCandVar" << std::endl;
814 Bool_t passConvRej =
true;
815 Bool_t passPXB =
true;
816 Bool_t passEMH =
true;
818 if (ele->
hasUserInt(
"PassConversionRejection")) {
820 if (not (ele->
userInt(
"PassConversionRejection")==1)) passConvRej =
false;
823 std::cout <<
"WenuPlots: WARNING: Conversion Rejection Request Disregarded: "
824 <<
"you must calculate it before " << std::endl;
829 if (ele->
hasUserInt(
"PassValidFirstPXBHit")) {
831 if (not (ele->
userInt(
"PassValidFirstPXBHit")==1)) passPXB =
false;
834 std::cout <<
"WenuPlots: WARNING: Valid First PXB Hit Request Disregarded: "
835 <<
"you must calculate it before " << std::endl;
840 if (ele->
hasUserInt(
"NumberOfExpectedMissingHits")) {
846 std::cout <<
"WenuPlots: WARNING: Number of Expected Missing Hits Request Disregarded: "
847 <<
"you must calculate it before " << std::endl;
851 return passConvRej && passPXB && passEMH;
862 h_met =
new TH1F(
"h_met",
"h_met", 200, 0, 200);
863 h_met_inverse =
new TH1F(
"h_met_inverse",
"h_met_inverse", 200, 0, 200);
865 h_mt =
new TH1F(
"h_mt",
"h_mt", 200, 0, 200);
866 h_mt_inverse =
new TH1F(
"h_mt_inverse",
"h_mt_inverse", 200, 0, 200);
869 h_met_EB =
new TH1F(
"h_met_EB",
"h_met_EB", 200, 0, 200);
870 h_met_inverse_EB =
new TH1F(
"h_met_inverse_EB",
"h_met_inverse_EB", 200, 0, 200);
872 h_mt_EB =
new TH1F(
"h_mt_EB",
"h_mt_EB", 200, 0, 200);
873 h_mt_inverse_EB =
new TH1F(
"h_mt_inverse_EB",
"h_mt_inverse_EB", 200, 0, 200);
876 h_met_EE =
new TH1F(
"h_met_EE",
"h_met_EE", 200, 0, 200);
877 h_met_inverse_EE =
new TH1F(
"h_met_inverse_EE",
"h_met_inverse_EE", 200, 0, 200);
879 h_mt_EE =
new TH1F(
"h_mt_EE",
"h_mt_EE", 200, 0, 200);
880 h_mt_inverse_EE =
new TH1F(
"h_mt_inverse_EE",
"h_mt_inverse_EE", 200, 0, 200);
883 h_scEt =
new TH1F(
"h_scEt",
"h_scEt", 200, 0, 100);
884 h_scEta =
new TH1F(
"h_scEta",
"h_scEta", 200, -3, 3);
885 h_scPhi =
new TH1F(
"h_scPhi",
"h_scPhi", 200, -4, 4);
890 h_EB_trkiso =
new TH1F(
"h_EB_trkiso",
"h_EB_trkiso",200 , 0.0, 9.0);
891 h_EB_ecaliso =
new TH1F(
"h_EB_ecaliso",
"h_EB_ecaliso",200, 0.0 , 9.0);
892 h_EB_hcaliso =
new TH1F(
"h_EB_hcaliso",
"h_EB_hcaliso",200, 0.0 , 9.0);
893 h_EB_sIetaIeta =
new TH1F(
"h_EB_sIetaIeta",
"h_EB_sIetaIeta",200, 0.0 , 0.02 );
894 h_EB_dphi =
new TH1F(
"h_EB_dphi",
"h_EB_dphi",200, -0.03 , 0.03 );
895 h_EB_deta =
new TH1F(
"h_EB_deta",
"h_EB_deta",200, -0.01 , 0.01) ;
896 h_EB_HoE =
new TH1F(
"h_EB_HoE",
"h_EB_HoE",200, 0.0 , 0.2 );
898 h_EE_trkiso =
new TH1F(
"h_EE_trkiso",
"h_EE_trkiso",200 , 0.0, 9.0);
899 h_EE_ecaliso =
new TH1F(
"h_EE_ecaliso",
"h_EE_ecaliso",200, 0.0 , 9.0);
900 h_EE_hcaliso =
new TH1F(
"h_EE_hcaliso",
"h_EE_hcaliso",200, 0.0 , 9.0);
901 h_EE_sIetaIeta =
new TH1F(
"h_EE_sIetaIeta",
"h_EE_sIetaIeta",200, 0.0 , 0.1 );
902 h_EE_dphi =
new TH1F(
"h_EE_dphi",
"h_EE_dphi",200, -0.03 , 0.03 );
903 h_EE_deta =
new TH1F(
"h_EE_deta",
"h_EE_deta",200, -0.01 , 0.01) ;
904 h_EE_HoE =
new TH1F(
"h_EE_HoE",
"h_EE_HoE",200, 0.0 , 0.2 );
910 new TH1F(
"h_trackIso_eb_NmOne",
"trackIso EB N-1 plot",80,0,8);
912 new TH1F(
"h_trackIso_ee_NmOne",
"trackIso EE N-1 plot",80,0,8);
989 "Tree to store the W Candidates that pass the VBTF selection");
1062 "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
bool isElectronIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Electron.
Int_t maxNumberOfExpectedMissingHits_
Bool_t PassPreselectionCriteria(const pat::Electron *ele)
std::string WENU_VBTFselectionFileName_
bool isNonnull() const
Checks for non-null.
edm::EDGetTokenT< std::vector< reco::Vertex > > PrimaryVerticesCollectionBSToken_
const LorentzVector & p4(P4Kind kind) const
float eSuperClusterOverP() const
virtual double et() const
transverse energy
Double_t trackIsoUser_EE_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Int_t ele2nd_passes_selection
virtual float phi() const
momentum azimuthal angle
Float_t event_caloMET_phi
TH1F * h_trackIso_ee_NmOne
math::XYZVectorF trackMomentumAtVtx() const
edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollectionToken_
std::string WENU_VBTFpreseleFileName_
WenuPlots(const edm::ParameterSet &)
edm::LuminosityBlockNumber_t luminosityBlock() const
Bool_t CheckCutInv(const pat::Electron *wenu, Int_t i)
Bool_t includeJetInformationInNtuples_
double deltaR(const T1 &t1, const T2 &t2)
Bool_t hcalIsoUser_EE_inv
edm::EDGetTokenT< std::vector< reco::Vertex > > PrimaryVerticesCollectionToken_
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
Bool_t useExpectedMissingHits_
float userFloat(const std::string &key) const
std::string usePrecalcIDSign_
edm::EDGetTokenT< reco::PFJetCollection > pfJetCollectionToken_
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
TFile * WENU_VBTFselectionFile_
Bool_t hcalIsoUser_EB_inv
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
float hadronicOverEm() const
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
Bool_t ecalIsoUser_EE_inv
Int_t event_triggerDecision
Float_t ele2nd_hltmatched_dr
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
virtual float eta() const
momentum pseudorapidity
math::XYZVectorF trackMomentumOut() const
float deltaPhiSuperClusterTrackAtVtx() const
Float_t ele_hltmatched_dr
Double_t usePrecalcIDValue_
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
double dB(IpType type=None) const
Impact parameter wrt primary vertex or beamspot.
float dr03TkSumPt() const
edm::InputTag caloJetCollectionTag_
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
list myMet
reset isoSum=0 for part in othertracks : ===> skip pfcands with a pt min (this should be 0) if part...
float scSigmaIEtaIEta() const
edm::EDGetTokenT< pat::CompositeCandidateCollection > wenuCollectionToken_
TH1F * h_trackIso_eb_NmOne
EventAuxiliary const & eventAuxiliary() const
const ChargeInfo & chargeInfo() const
Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj)
float userIsolation(IsolationKeys key) const
float hcalDepth2TowerSumEt
std::vector< CompositeCandidate > CompositeCandidateCollection
T const * product() const
Bool_t trackIsoUser_EE_inv
int32_t userInt(const std::string &key) const
Bool_t storeExtraInformation_
Analysis-level electron class.
float dr03EcalRecHitSumEt() const
Bool_t useValidFirstPXBHit_
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
static int position[264][3]
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
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)