herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
LeptonsJetsAnalysis.h
1 // -*- C++ -*-
2 #ifndef Herwig_LeptonsJetsAnalysis_H
3 #define Herwig_LeptonsJetsAnalysis_H
4 //
5 // This is the declaration of the LeptonsJetsAnalysis class.
6 //
7 
8 #include "ThePEG/Handlers/AnalysisHandler.h"
9 #include "ThePEG/Cuts/JetFinder.h"
10 #include "ThePEG/Cuts/JetRegion.h"
11 #include "ThePEG/Repository/EventGenerator.h"
12 #include "Herwig/Utilities/Statistics/Histogram.h"
13 
14 namespace Herwig {
15 
16 using namespace ThePEG;
17 
25 
26 public:
27 
34 
38  virtual ~LeptonsJetsAnalysis();
40 
41 public:
42 
62  virtual void analyze(tEventPtr event, long ieve, int loop, int state);
64 
65 protected:
66 
70  void analyze(ParticleVector&, long, double);
71 
75  void clear() {
76  theJets.clear();
77  theEWIDs.clear();
78  theChargedLeptons.clear();
79  theNeutrinos.clear();
80  theHiggs.clear();
81  }
82 
86  virtual void reconstructJets(const ParticleVector&);
87 
91  Ptr<JetFinder>::tptr jetFinder() const {
92  return theJetFinder;
93  }
94 
98  const vector<Ptr<JetRegion>::ptr>& jetRegions() const { return theJetRegions; }
99 
103  unsigned int nJets() const { return theJets.size(); }
104 
108  LorentzMomentum& jetMomentum(const unsigned int id) {
109  return theJets[id];
110  }
111 
115  virtual void reconstructEWParticles(ParticleVector&);
116 
120  LorentzMomentum& eWIDMomentum(const unsigned int id) {
121  return theEWIDs[id];
122  }
123 
127  LorentzMomentum& chargedLeptonMomentum(const unsigned int id) {
128  return theChargedLeptons[id];
129  }
130 
134  LorentzMomentum& neutrinoMomentum(const unsigned int id) {
135  return theNeutrinos[id];
136  }
137 
141  LorentzMomentum& pTmissMomentum() {
142  return thePTmiss;
143  }
144 
148  LorentzMomentum& higgsMomentum(const unsigned int id) {
149  return theHiggs[id];
150  }
151 
152 protected:
153 
158  virtual void dofinish();
159 
160 public:
161 
168  void persistentOutput(PersistentOStream & os) const;
169 
175  void persistentInput(PersistentIStream & is, int version);
177 
184  static void Init();
185 
186 protected:
187 
194  virtual IBPtr clone() const;
195 
200  virtual IBPtr fullclone() const;
202 
203 
204 // If needed, insert declarations of virtual function defined in the
205 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
206 
207 protected:
208 
214 
219  Statistics::Histogram ptlow;
220  Statistics::Histogram pt_logx;
221 
226 
231 
236  Statistics::Histogram masslow;
237 
242 
246  ObjectProperties(const string& name, Energy)
247  : pt(name + "Pt",Statistics::Histogram::regularBinEdges(0,1000,200),true,false),
248  ptlow(name + "Ptlow",Statistics::Histogram::regularBinEdges(0,200,100),true,false),
249  pt_logx(name + "PtLogX",Statistics::Histogram::logBinEdges(0.1,1000,100),true,false),
250  y(name + "Y",Statistics::Histogram::regularBinEdges(-6,6,120),false,false),
251  phi(name + "Phi",Statistics::Histogram::regularBinEdges(-Constants::pi,Constants::pi,62),
252  make_pair(-Constants::pi,Constants::pi)),
253  mass(name + "Mass",Statistics::Histogram::regularBinEdges(0,5000,500),true,false),
254  masslow(name + "Masslow",Statistics::Histogram::regularBinEdges(0,250,100),true,false) {}
255 
259  void count(const LorentzMomentum& p, double weight, unsigned int id) {
260  pt.count(Statistics::EventContribution(p.perp()/GeV,weight,5.),id);
261  ptlow.count(Statistics::EventContribution(p.perp()/GeV,weight,2.),id);
262  pt_logx.count(Statistics::EventContribution(p.perp()/GeV,weight,1.),id);
263  y.count(Statistics::EventContribution(p.rapidity(),weight,0.1),id);
264  phi.count(Statistics::EventContribution(p.phi(),weight,0.1),id);
265  mass.count(Statistics::EventContribution(p.m()/GeV,weight,10.),id);
266  masslow.count(Statistics::EventContribution(p.m()/GeV,weight,2.5),id);
267  }
268 
272  void count(Energy perp, double rapidity,
273  double xphi, Energy m,
274  double weight, unsigned int id) {
275  pt.count(Statistics::EventContribution(perp/GeV,weight,5.),id);
276  ptlow.count(Statistics::EventContribution(perp/GeV,weight,1.),id);
277  pt_logx.count(Statistics::EventContribution(perp/GeV,weight,1.),id);
278  y.count(Statistics::EventContribution(rapidity,weight,0.1),id);
279  phi.count(Statistics::EventContribution(xphi,weight,0.1),id);
280  mass.count(Statistics::EventContribution(m/GeV,weight,5.),id);
281  masslow.count(Statistics::EventContribution(m/GeV,weight,1.25),id);
282  }
283 
287  void finalize(XML::Element& elem) {
288  pt.finalize(); elem.append(pt.toXML());
289  ptlow.finalize(); elem.append(ptlow.toXML());
290  pt_logx.finalize(); elem.append(pt_logx.toXML());
291  y.finalize(); elem.append(y.toXML());
292  phi.finalize(); elem.append(phi.toXML());
293  mass.finalize(); elem.append(mass.toXML());
294  masslow.finalize(); elem.append(masslow.toXML());
295  }
296 
297  };
298 
304  : public ObjectProperties {
305 
309  static double dPhi(const LorentzMomentum& a,
310  const LorentzMomentum& b){
311  double phi1 = a.phi();
312  double phi2 = b.phi();
313  double diff=phi1-phi2;
314  if(diff<-Constants::pi){
315  diff+=(2.0*Constants::pi);
316  }
317  else if (diff>Constants::pi){
318  diff-=(2.0*Constants::pi);
319  }
320  return diff;
321  }
322 
326  static double dY(const LorentzMomentum& a,
327  const LorentzMomentum& b){
328  return abs(a.rapidity()-b.rapidity());
329  }
330 
334  static double dR(const LorentzMomentum& a,
335  const LorentzMomentum& b){
336  return sqrt(sqr(dPhi(a,b))+sqr(dY(a,b)));
337  }
338 
342  static double yy(const LorentzMomentum& a,
343  const LorentzMomentum& b){
344  double ya = a.rapidity();
345  double yb = b.rapidity();
346  double yres = sqrt(abs(ya*yb));
347  return ya*yb < 0. ? -yres : yres;
348  }
349 
354 
359 
364 
369 
374  : ObjectProperties() {}
375 
379  PairProperties(const string& name, Energy ecm)
380  : ObjectProperties(name,ecm),
381  deltaY(name + "DeltaY",Statistics::Histogram::regularBinEdges(0,6,60),true,false),
382  deltaPhi(name + "DeltaPhi",Statistics::Histogram::regularBinEdges(-Constants::pi,Constants::pi,32),
383  make_pair(-Constants::pi,Constants::pi)),
384  deltaR(name + "DeltaR",Statistics::Histogram::regularBinEdges(0,10,100),true,false),
385  yDotY(name + "YDotY",Statistics::Histogram::regularBinEdges(-6,6,120),false,false) {}
386 
390  void count(const LorentzMomentum& p, const LorentzMomentum& q, double weight, unsigned int id) {
391  ObjectProperties::count(p+q,weight,id);
392  deltaY.count(Statistics::EventContribution(dY(p,q),weight,0.1),id);
393  deltaPhi.count(Statistics::EventContribution(dPhi(p,q),weight,0.1),id);
394  deltaR.count(Statistics::EventContribution(dR(p,q),weight,0.1),id);
395  yDotY.count(Statistics::EventContribution(yy(p,q),weight,0.1),id);
396  }
397 
401  void finalize(XML::Element& elem) {
402  ObjectProperties::finalize(elem);
403  deltaY.finalize(); elem.append(deltaY.toXML());
404  deltaPhi.finalize(); elem.append(deltaPhi.toXML());
405  deltaR.finalize(); elem.append(deltaR.toXML());
406  yDotY.finalize(); elem.append(yDotY.toXML());
407  }
408 
409  };
410 
416  : public ObjectProperties {
417 
421  static double dYstar(const LorentzMomentum& a,
422  const LorentzMomentum& b,
423  const LorentzMomentum& c){
424  return c.rapidity()-(a.rapidity()+b.rapidity())/2.;
425  }
426 
430  static double dZstar(const LorentzMomentum& a,
431  const LorentzMomentum& b,
432  const LorentzMomentum& c){
433  return dYstar(a,b,c)*2./abs(a.rapidity()-b.rapidity());
434  }
435 
440 
445 
450  : ObjectProperties() {}
451 
455  TripleProperties(const string& name, Energy ecm)
456  : ObjectProperties(name,ecm),
457  deltaYstar(name + "DeltaYstar",Statistics::Histogram::regularBinEdges(-6,6,120),true,false),
458  deltaZstar(name + "DeltaZstar",Statistics::Histogram::regularBinEdges(-3,3,120),true,false) {}
459 
463  void count(const LorentzMomentum& p, const LorentzMomentum& q, const LorentzMomentum& r,
464  double weight, unsigned int id) {
465  ObjectProperties::count(p+q+r,weight,id);
466  deltaYstar.count(Statistics::EventContribution(dYstar(p,q,r),weight,0.1),id);
467  deltaZstar.count(Statistics::EventContribution(dZstar(p,q,r),weight,0.05),id);
468  }
469 
473  void finalize(XML::Element& elem) {
474  ObjectProperties::finalize(elem);
475  deltaYstar.finalize(); elem.append(deltaYstar.toXML());
476  deltaZstar.finalize(); elem.append(deltaZstar.toXML());
477  }
478 
479  };
480 
481 private:
482 
487 
492 
496  Ptr<JetFinder>::ptr theJetFinder;
497 
501  vector<Ptr<JetRegion>::ptr> theJetRegions;
502 
506  map<unsigned int,LorentzMomentum> theJets;
507 
511  map<unsigned int,LorentzMomentum> theEWIDs;
512 
516  map<unsigned int,LorentzMomentum> theChargedLeptons;
517 
521  map<unsigned int,LorentzMomentum> theNeutrinos;
522 
526  LorentzMomentum thePTmiss;
527 
531  map<unsigned int,LorentzMomentum> theHiggs;
532 
536  map<unsigned int,ObjectProperties> theJetProperties;
537 
541  map<unsigned int,ObjectProperties> theExclusiveJetProperties;
542 
547 
552 
557 
562 
567 
571  map<unsigned int,ObjectProperties> theEWIDProperties;
572 
576  map<unsigned int,ObjectProperties> theChargedLeptonProperties;
577 
581  map<unsigned int,ObjectProperties> theNeutrinoProperties;
582 
587 
591  map<unsigned int,ObjectProperties> theHiggsProperties;
592 
596  map<pair<unsigned int,unsigned int>,PairProperties> theJetPairProperties;
597 
601  map<pair<unsigned int,unsigned int>,PairProperties> theJetEWIDPairProperties;
602 
606  map<pair<unsigned int,unsigned int>,PairProperties> theJetChargedLeptonPairProperties;
607 
611  map<pair<unsigned int,unsigned int>,PairProperties> theJetNeutrinoPairProperties;
612 
616  map<unsigned int,PairProperties> theJetPTmissPairProperties;
617 
621  map<pair<unsigned int,unsigned int>,PairProperties> theJetHiggsPairProperties;
622 
626  map<pair<unsigned int,unsigned int>,PairProperties> theEWIDPairProperties;
627 
631  map<pair<unsigned int,unsigned int>,PairProperties> theChargedLeptonPairProperties;
632 
636  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theThreeJetProperties;
637 
641  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theJetPairEWIDTripleProperties;
642 
646  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theJetPairChargedLeptonTripleProperties;
647 
651  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theJetPairNeutrinoTripleProperties;
652 
656  map<pair<unsigned int,unsigned int>,TripleProperties> theJetPairPTmissTripleProperties;
657 
661  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theJetPairHiggsTripleProperties;
662 
666  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theThreeEWIDProperties;
667 
671  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties> theThreeChargedLeptonProperties;
672 
676  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties> theFourJetProperties;
677 
681  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties> theFourEWIDProperties;
682 
686  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties> theFourChargedLeptonProperties;
687 
688 protected:
689 
693  ObjectProperties& jetProperties(const unsigned int id) {
694  map<unsigned int,ObjectProperties>::iterator h =
695  theJetProperties.find(id);
696  if ( h != theJetProperties.end() )
697  return h->second;
698  ostringstream ids; ids << "Jet" << id;
699  return
700  theJetProperties[id] =
701  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
702  }
703 
707  ObjectProperties& exclusiveJetProperties(const unsigned int id) {
708  map<unsigned int,ObjectProperties>::iterator h =
709  theExclusiveJetProperties.find(id);
710  if ( h != theExclusiveJetProperties.end() )
711  return h->second;
712  ostringstream ids; ids << "ExclusiveJet" << id;
713  return
714  theExclusiveJetProperties[id] =
715  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
716  }
717 
722  if ( !theJetInclusiveProperties.pt.bins().empty() )
723  return theJetInclusiveProperties;
724  return
725  theJetInclusiveProperties =
726  ObjectProperties("JetInclusive",generator()->maximumCMEnergy());
727  }
728 
733  if ( !theJetSummedProperties.pt.bins().empty() )
734  return theJetSummedProperties;
735  return
736  theJetSummedProperties =
737  ObjectProperties("JetSummed",generator()->maximumCMEnergy());
738  }
739 
744  if ( !theJetAverageProperties.pt.bins().empty() )
745  return theJetAverageProperties;
746  return
747  theJetAverageProperties =
748  ObjectProperties("JetAverage",generator()->maximumCMEnergy());
749  }
750 
751 
756  if ( !theNJetsInclusive.bins().empty() )
757  return theNJetsInclusive;
758  return
759  theNJetsInclusive =
760  Statistics::Histogram("NJetsInclusive",
761  Statistics::Histogram::regularBinEdges(-0.5,theJetRegions.size()+0.5,
762  theJetRegions.size()+1),
763  true,true);
764  }
765 
770  if ( !theNJetsExclusive.bins().empty() )
771  return theNJetsExclusive;
772  return
773  theNJetsExclusive =
774  Statistics::Histogram("NJetsExclusive",
775  Statistics::Histogram::regularBinEdges(-0.5,theJetRegions.size()+0.5,
776  theJetRegions.size()+1),
777  true,true);
778  }
779 
783  ObjectProperties& eWIDProperties(const unsigned int id) {
784  map<unsigned int,ObjectProperties>::iterator h =
785  theEWIDProperties.find(id);
786  if ( h != theEWIDProperties.end() )
787  return h->second;
788  ostringstream ids; ids << "EWID" << id;
789  return
790  theEWIDProperties[id] =
791  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
792  }
793 
797  ObjectProperties& chargedLeptonProperties(const unsigned int id) {
798  map<unsigned int,ObjectProperties>::iterator h =
799  theChargedLeptonProperties.find(id);
800  if ( h != theChargedLeptonProperties.end() )
801  return h->second;
802  ostringstream ids; ids << "ChargedLepton" << id;
803  return
804  theChargedLeptonProperties[id] =
805  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
806  }
807 
811  ObjectProperties& neutrinoProperties(const unsigned int id) {
812  map<unsigned int,ObjectProperties>::iterator h =
813  theNeutrinoProperties.find(id);
814  if ( h != theNeutrinoProperties.end() )
815  return h->second;
816  ostringstream ids; ids << "Neutrino" << id;
817  return
818  theNeutrinoProperties[id] =
819  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
820  }
821 
826  if ( !thePTmissProperties.pt.bins().empty() )
827  return thePTmissProperties;
828  return
829  thePTmissProperties =
830  ObjectProperties("PTmiss",generator()->maximumCMEnergy());
831  }
832 
836  ObjectProperties& higgsProperties(const unsigned int id) {
837  map<unsigned int,ObjectProperties>::iterator h =
838  theHiggsProperties.find(id);
839  if ( h != theHiggsProperties.end() )
840  return h->second;
841  ostringstream ids; ids << "Higgs" << id;
842  return
843  theHiggsProperties[id] =
844  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
845  }
846 
850  PairProperties& jetPairProperties(const unsigned int id, const unsigned int jd) {
851  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
852  theJetPairProperties.find(make_pair(id,jd));
853  if ( h != theJetPairProperties.end() )
854  return h->second;
855  ostringstream ids; ids << "Jet" << id << jd;
856  return theJetPairProperties[make_pair(id,jd)] =
857  PairProperties(ids.str(),generator()->maximumCMEnergy());
858  }
859 
863  PairProperties& jetEWIDPairProperties(const unsigned int id, const unsigned int jd) {
864  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
865  theJetEWIDPairProperties.find(make_pair(id,jd));
866  if ( h != theJetEWIDPairProperties.end() )
867  return h->second;
868  ostringstream ids; ids << "Jet" << id << "EWID" << jd;
869  return theJetEWIDPairProperties[make_pair(id,jd)] =
870  PairProperties(ids.str(),generator()->maximumCMEnergy());
871  }
872 
876  PairProperties& jetChargedLeptonPairProperties(const unsigned int id, const unsigned int jd) {
877  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
878  theJetChargedLeptonPairProperties.find(make_pair(id,jd));
879  if ( h != theJetChargedLeptonPairProperties.end() )
880  return h->second;
881  ostringstream ids; ids << "Jet" << id << "ChargedLepton" << jd;
882  return theJetChargedLeptonPairProperties[make_pair(id,jd)] =
883  PairProperties(ids.str(),generator()->maximumCMEnergy());
884  }
885 
889  PairProperties& jetNeutrinoPairProperties(const unsigned int id, const unsigned int jd) {
890  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
891  theJetNeutrinoPairProperties.find(make_pair(id,jd));
892  if ( h != theJetNeutrinoPairProperties.end() )
893  return h->second;
894  ostringstream ids; ids << "Jet" << id << "Neutrino" << jd;
895  return theJetNeutrinoPairProperties[make_pair(id,jd)] =
896  PairProperties(ids.str(),generator()->maximumCMEnergy());
897  }
898 
902  PairProperties& jetPTmissPairProperties(const unsigned int id) {
903  map<unsigned int,PairProperties>::iterator h =
904  theJetPTmissPairProperties.find(id);
905  if ( h != theJetPTmissPairProperties.end() )
906  return h->second;
907  ostringstream ids; ids << "Jet" << id << "PTmiss";
908  return theJetPTmissPairProperties[id] =
909  PairProperties(ids.str(),generator()->maximumCMEnergy());
910  }
911 
915  PairProperties& jetHiggsPairProperties(const unsigned int id, const unsigned int jd) {
916  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
917  theJetHiggsPairProperties.find(make_pair(id,jd));
918  if ( h != theJetHiggsPairProperties.end() )
919  return h->second;
920  ostringstream ids; ids << "Jet" << id << "Higgs" << jd;
921  return theJetHiggsPairProperties[make_pair(id,jd)] =
922  PairProperties(ids.str(),generator()->maximumCMEnergy());
923  }
924 
928  PairProperties& eWIDPairProperties(const unsigned int id, const unsigned int jd) {
929  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
930  theEWIDPairProperties.find(make_pair(id,jd));
931  if ( h != theEWIDPairProperties.end() )
932  return h->second;
933  ostringstream ids; ids << "EWID" << id << jd;
934  return theEWIDPairProperties[make_pair(id,jd)] =
935  PairProperties(ids.str(),generator()->maximumCMEnergy());
936  }
937 
941  PairProperties& chargedLeptonPairProperties(const unsigned int id, const unsigned int jd) {
942  map<pair<unsigned int,unsigned int>,PairProperties>::iterator h =
943  theChargedLeptonPairProperties.find(make_pair(id,jd));
944  if ( h != theChargedLeptonPairProperties.end() )
945  return h->second;
946  ostringstream ids; ids << "ChargedLepton" << id << jd;
947  return theChargedLeptonPairProperties[make_pair(id,jd)] =
948  PairProperties(ids.str(),generator()->maximumCMEnergy());
949  }
950 
954  TripleProperties& threeJetProperties(const unsigned int id1, const unsigned int id2,
955  const unsigned int id3) {
956  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
957  theThreeJetProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
958  if ( it != theThreeJetProperties.end() )
959  return it->second;
960  ostringstream ids;
961  ids << "Jet" << id1 << id2 << id3;
962  return theThreeJetProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
963  TripleProperties(ids.str(),generator()->maximumCMEnergy());
964  }
965 
969  TripleProperties& jetPairEWIDTripleProperties(const unsigned int id1, const unsigned int id2,
970  const unsigned int id3) {
971  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
972  theJetPairEWIDTripleProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
973  if ( it != theJetPairEWIDTripleProperties.end() )
974  return it->second;
975  ostringstream ids;
976  ids << "Jet" << id1 << id2 << "EWID" << id3;
977  return theJetPairEWIDTripleProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
978  TripleProperties(ids.str(),generator()->maximumCMEnergy());
979  }
980 
984  TripleProperties& jetPairChargedLeptonTripleProperties(const unsigned int id1, const unsigned int id2,
985  const unsigned int id3) {
986  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
987  theJetPairChargedLeptonTripleProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
988  if ( it != theJetPairChargedLeptonTripleProperties.end() )
989  return it->second;
990  ostringstream ids;
991  ids << "Jet" << id1 << id2 << "ChargedLepton" << id3;
992  return theJetPairChargedLeptonTripleProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
993  TripleProperties(ids.str(),generator()->maximumCMEnergy());
994  }
995 
999  TripleProperties& jetPairNeutrinoTripleProperties(const unsigned int id1, const unsigned int id2,
1000  const unsigned int id3) {
1001  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
1002  theJetPairNeutrinoTripleProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
1003  if ( it != theJetPairNeutrinoTripleProperties.end() )
1004  return it->second;
1005  ostringstream ids;
1006  ids << "Jet" << id1 << id2 << "Neutrino" << id3;
1007  return theJetPairNeutrinoTripleProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
1008  TripleProperties(ids.str(),generator()->maximumCMEnergy());
1009  }
1010 
1014  TripleProperties& jetPairPTmissTripleProperties(const unsigned int id1, const unsigned int id2) {
1015  map<pair<unsigned int,unsigned int>,TripleProperties>::iterator it =
1016  theJetPairPTmissTripleProperties.find(pair<unsigned int,unsigned int>(id1,id2));
1017  if ( it != theJetPairPTmissTripleProperties.end() )
1018  return it->second;
1019  ostringstream ids;
1020  ids << "Jet" << id1 << id2 << "PTmiss";
1021  return theJetPairPTmissTripleProperties[pair<unsigned int,unsigned int>(id1,id2)] =
1022  TripleProperties(ids.str(),generator()->maximumCMEnergy());
1023  }
1024 
1028  TripleProperties& jetPairHiggsTripleProperties(const unsigned int id1, const unsigned int id2,
1029  const unsigned int id3) {
1030  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
1031  theJetPairHiggsTripleProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
1032  if ( it != theJetPairHiggsTripleProperties.end() )
1033  return it->second;
1034  ostringstream ids;
1035  ids << "Jet" << id1 << id2 << "Higgs" << id3;
1036  return theJetPairHiggsTripleProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
1037  TripleProperties(ids.str(),generator()->maximumCMEnergy());
1038  }
1039 
1043  TripleProperties& threeEWIDProperties(const unsigned int id1, const unsigned int id2,
1044  const unsigned int id3) {
1045  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
1046  theThreeEWIDProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
1047  if ( it != theThreeEWIDProperties.end() )
1048  return it->second;
1049  ostringstream ids;
1050  ids << "EWID" << id1 << id2 << id3;
1051  return theThreeEWIDProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
1052  TripleProperties(ids.str(),generator()->maximumCMEnergy());
1053  }
1054 
1058  TripleProperties& threeChargedLeptonProperties(const unsigned int id1, const unsigned int id2,
1059  const unsigned int id3) {
1060  map<std::tuple<unsigned int,unsigned int,unsigned int>,TripleProperties>::iterator it =
1061  theThreeChargedLeptonProperties.find(std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3));
1062  if ( it != theThreeChargedLeptonProperties.end() )
1063  return it->second;
1064  ostringstream ids;
1065  ids << "ChargedLepton" << id1 << id2 << id3;
1066  return theThreeChargedLeptonProperties[std::tuple<unsigned int,unsigned int,unsigned int>(id1,id2,id3)] =
1067  TripleProperties(ids.str(),generator()->maximumCMEnergy());
1068  }
1069 
1073  ObjectProperties& fourJetProperties(const unsigned int id1, const unsigned int id2,
1074  const unsigned int id3, const unsigned int id4) {
1075  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties>::iterator it =
1076  theFourJetProperties.find(std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4));
1077  if ( it != theFourJetProperties.end() )
1078  return it->second;
1079  ostringstream ids;
1080  ids << "Jet" << id1 << id2 << id3 << id4;
1081  return theFourJetProperties[std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4)] =
1082  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
1083  }
1084 
1088  ObjectProperties& fourEWIDProperties(const unsigned int id1, const unsigned int id2,
1089  const unsigned int id3, const unsigned int id4) {
1090  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties>::iterator it =
1091  theFourEWIDProperties.find(std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4));
1092  if ( it != theFourEWIDProperties.end() )
1093  return it->second;
1094  ostringstream ids;
1095  ids << "EWID" << id1 << id2 << id3 << id4;
1096  return theFourEWIDProperties[std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4)] =
1097  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
1098  }
1099 
1103  ObjectProperties& fourChargedLeptonProperties(const unsigned int id1, const unsigned int id2,
1104  const unsigned int id3, const unsigned int id4) {
1105  map<std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>,ObjectProperties>::iterator it =
1106  theFourChargedLeptonProperties.find(std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4));
1107  if ( it != theFourChargedLeptonProperties.end() )
1108  return it->second;
1109  ostringstream ids;
1110  ids << "ChargedLepton" << id1 << id2 << id3 << id4;
1111  return theFourChargedLeptonProperties[std::tuple<unsigned int,unsigned int,unsigned int,unsigned int>(id1,id2,id3,id4)] =
1112  ObjectProperties(ids.str(),generator()->maximumCMEnergy());
1113  }
1114 
1118  virtual void analyzeSpecial(long, double) {}
1119 
1123  virtual void finalize(XML::Element&) {}
1124 
1125 private:
1126 
1131  LeptonsJetsAnalysis & operator=(const LeptonsJetsAnalysis &) = delete;
1132 
1133 };
1134 
1135 }
1136 
1137 #endif /* Herwig_LeptonsJetsAnalysis_H */
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theJetPairChargedLeptonTripleProperties
Jet-pair/charged lepton triple properties.
A (one dimensional) histogram.
ObjectProperties & fourJetProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3, const unsigned int id4)
Fourjet properties.
TripleProperties & jetPairHiggsTripleProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Jet-pair/Higgs triple properties.
Statistics::Histogram theNJetsInclusive
Inclusive jet multiplicities.
PairProperties & eWIDPairProperties(const unsigned int id, const unsigned int jd)
Electroweak pair properties.
ObjectProperties thePTmissProperties
missing pT properties
map< pair< unsigned int, unsigned int >, PairProperties > theJetHiggsPairProperties
Jet/Higgs pair properties.
PairProperties & jetPTmissPairProperties(const unsigned int id)
Jet/missing pT pair properties.
virtual void finalize(XML::Element &)
Append any additional histograms to the given histogram element.
Statistics::Histogram yDotY
Product of the rapidities.
Collection of pair histograms; ranges are adjusted to the maximum, so range constraints and rebinning...
static double dYstar(const LorentzMomentum &a, const LorentzMomentum &b, const LorentzMomentum &c)
Calculate deltaY^*.
void finalize(XML::Element &elem)
Convert to XML.
double sqrt(int x)
LorentzMomentum & chargedLeptonMomentum(const unsigned int id)
Set the momentum of the indicated charged lepton.
map< std::tuple< unsigned int, unsigned int, unsigned int, unsigned int >, ObjectProperties > theFourJetProperties
Fourjet properties.
ObjectProperties & eWIDProperties(const unsigned int id)
Lepton properties – all sorted by ID.
map< std::tuple< unsigned int, unsigned int, unsigned int, unsigned int >, ObjectProperties > theFourChargedLeptonProperties
Four charged lepton properties.
map< unsigned int, ObjectProperties > theJetProperties
Jet properties.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theThreeEWIDProperties
Triple electroweak properties.
const vector< Ptr< JetRegion >::ptr > & jetRegions() const
The jet regions to match.
PairProperties(const string &name, Energy ecm)
Construct given Ecm.
Element & append(const Element &)
Append a child element to this element.
TripleProperties & threeEWIDProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Triple electroweak properties – all sorted by ID.
ObjectProperties & jetInclusiveProperties()
Jet-inclusive properties.
void finalize()
Finalize this histogram.
Collection of triple histograms; ranges are adjusted to the maximum, so range constraints and rebinni...
TripleProperties & threeChargedLeptonProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Triple charged lepton properties.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
constexpr double pi
TripleProperties & jetPairPTmissTripleProperties(const unsigned int id1, const unsigned int id2)
Jet-pair/missing pT triple properties.
The Histogram class is a simple histogram for the Analysis handlers.
Definition: Histogram.h:43
map< unsigned int, LorentzMomentum > theChargedLeptons
The reconstructed charged leptons.
constexpr auto sqr(const T &x) -> decltype(x *x)
static double dPhi(const LorentzMomentum &a, const LorentzMomentum &b)
Calculate deltaPhi.
void clear()
Clear the electroweak objects and jets for the next event.
Ptr< JetFinder >::ptr theJetFinder
The jet finder to use.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theThreeJetProperties
Trijet properties.
Ptr< JetFinder >::tptr jetFinder() const
The jet finder to use.
map< unsigned int, ObjectProperties > theNeutrinoProperties
Neutrino properties.
map< unsigned int, LorentzMomentum > theJets
The reconstructed jets.
ObjectProperties theJetAverageProperties
Jet-average properties.
Definition: Bin.h:16
ObjectProperties theJetSummedProperties
Jet-summed properties.
void finalize(XML::Element &elem)
Convert to XML.
PairProperties & jetEWIDPairProperties(const unsigned int id, const unsigned int jd)
Jet/lepton(all sorted by ID) pair properties.
map< unsigned int, ObjectProperties > theHiggsProperties
Higgs properties.
map< pair< unsigned int, unsigned int >, PairProperties > theJetPairProperties
Jet pair properties.
LorentzMomentum & pTmissMomentum()
Set the missing pT momentum.
static double dZstar(const LorentzMomentum &a, const LorentzMomentum &b, const LorentzMomentum &c)
Calculate deltaZ^* – normalized deltaY^*.
map< std::tuple< unsigned int, unsigned int, unsigned int, unsigned int >, ObjectProperties > theFourEWIDProperties
Four electroweak properties.
PairProperties & jetNeutrinoPairProperties(const unsigned int id, const unsigned int jd)
Jet/neutrino pair properties.
TripleProperties & jetPairNeutrinoTripleProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Jet-pair/neutrino triple properties.
map< unsigned int, LorentzMomentum > theHiggs
The reconstructed Higgs.
TripleProperties & threeJetProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Trijet properties.
static double dY(const LorentzMomentum &a, const LorentzMomentum &b)
Calculate deltaY.
map< pair< unsigned int, unsigned int >, PairProperties > theJetNeutrinoPairProperties
Jet/neutrino pair properties.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theJetPairEWIDTripleProperties
Jet-pair/electroweak triple properties.
map< unsigned int, PairProperties > theJetPTmissPairProperties
Jet/missing pT pair properties.
LorentzMomentum & higgsMomentum(const unsigned int id)
Set the momentum of the indicated Higgs.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theJetPairHiggsTripleProperties
Jet-pair/Higgs triple properties.
unsigned int nJets() const
Return the number of matched jets.
ObjectProperties & neutrinoProperties(const unsigned int id)
Neutrino properties.
ObjectProperties & jetAverageProperties()
Jet-average properties.
Statistics::Histogram & nJetsInclusive()
Inclusive jet multiplicities.
ObjectProperties & pTmissProperties()
Missing pT properties.
map< unsigned int, LorentzMomentum > theNeutrinos
The reconstructed neutrinos.
Statistics::Histogram deltaR
Delta phi.
PairProperties & chargedLeptonPairProperties(const unsigned int id, const unsigned int jd)
Charged lepton pair properties.
void count(const LorentzMomentum &p, const LorentzMomentum &q, const LorentzMomentum &r, double weight, unsigned int id)
Count given momentum, weight and id.
PairProperties & jetPairProperties(const unsigned int id, const unsigned int jd)
Jet pair properties.
ObjectProperties & exclusiveJetProperties(const unsigned int id)
Exclusive jet properties.
map< unsigned int, ObjectProperties > theChargedLeptonProperties
Charged lepton properties.
const std::vector< Bin > & bins() const
Return the bins.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theThreeChargedLeptonProperties
Triple charged lepton properties.
ObjectProperties & fourChargedLeptonProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3, const unsigned int id4)
Four charged lepton properties.
ObjectProperties & jetSummedProperties()
Jet-summed properties.
void count(const LorentzMomentum &p, const LorentzMomentum &q, double weight, unsigned int id)
Count given momentum, weight and id.
ObjectProperties & higgsProperties(const unsigned int id)
Higgs properties.
XML::Element toXML() const
Return an XML element for the data of this histogram.
Here is the documentation of the LeptonsJetsAnalysis class.
static double dR(const LorentzMomentum &a, const LorentzMomentum &b)
Calculate deltaR.
PairProperties & jetChargedLeptonPairProperties(const unsigned int id, const unsigned int jd)
Jet/charged lepton pair properties.
void count(const LorentzMomentum &p, double weight, unsigned int id)
Count given momentum, weight and id.
TripleProperties(const string &name, Energy ecm)
Construct given Ecm.
static std::vector< double > regularBinEdges(double lower, double upper, size_t nBins)
Create equally spaced bin edges.
virtual void analyzeSpecial(long, double)
Perform any additional analysis required.
static double yy(const LorentzMomentum &a, const LorentzMomentum &b)
Calculate ydoty.
bool theApplyCuts
Switch whether to apply extra analysis cuts.
Collection of object histograms; ranges are adjusted to the maximum, so range constraints and rebinni...
Statistics::Histogram & nJetsExclusive()
Exclusive jet multiplicities.
A pointlike or boxlike eventContribution; serves to define the EventContribution concept.
TripleProperties & jetPairEWIDTripleProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Jet-pair/electroweak triple properties.
Element represents a (tree of) XML elements.
Definition: Element.h:56
bool theIsShowered
Switch between fixed order and showered.
vector< Ptr< JetRegion >::ptr > theJetRegions
The jet regions to match.
map< pair< unsigned int, unsigned int >, PairProperties > theJetChargedLeptonPairProperties
Jet/charged lepton pair properties.
TripleProperties & jetPairChargedLeptonTripleProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3)
Jet-pair/charged lepton triple properties.
ThePEG::Ptr< Event >::transient_pointer tEventPtr
bool count(EventContribution event, size_t id)
Book a contribution to the current event.
Statistics::Histogram theNJetsExclusive
Exclusive jet multiplicities.
void count(Energy perp, double rapidity, double xphi, Energy m, double weight, unsigned int id)
Count given momentum components, weight and id.
ObjectProperties & chargedLeptonProperties(const unsigned int id)
Charged lepton properties.
map< pair< unsigned int, unsigned int >, PairProperties > theChargedLeptonPairProperties
Charged lepton pair properties.
-*- C++ -*-
Statistics::Histogram pt
Transverse momentum.
Statistics::Histogram deltaPhi
Delta phi.
map< pair< unsigned int, unsigned int >, PairProperties > theJetEWIDPairProperties
Jet/electroweak pair properties.
map< std::tuple< unsigned int, unsigned int, unsigned int >, TripleProperties > theJetPairNeutrinoTripleProperties
Jet-pair/neutrino triple properties.
map< pair< unsigned int, unsigned int >, TripleProperties > theJetPairPTmissTripleProperties
Jet-pair/missing pT triple properties.
map< unsigned int, LorentzMomentum > theEWIDs
The reconstructed electroweak particles.
ObjectProperties & jetProperties(const unsigned int id)
Jet properties.
map< pair< unsigned int, unsigned int >, PairProperties > theEWIDPairProperties
Electroweak pair properties.
PairProperties & jetHiggsPairProperties(const unsigned int id, const unsigned int jd)
Jet/Higgs pair properties.
LorentzMomentum & neutrinoMomentum(const unsigned int id)
Set the momentum of the indicated neutrino.
vector< PPtr > ParticleVector
ObjectProperties theJetInclusiveProperties
Jet-inclusive properties.
ObjectProperties(const string &name, Energy)
Construct given Ecm.
map< unsigned int, ObjectProperties > theExclusiveJetProperties
Exclusive jet properties.
Statistics::Histogram deltaZstar
Delta z^*.
LorentzMomentum thePTmiss
The reconstructed missing pT.
Statistics::Histogram deltaYstar
Delta y^*.
LorentzMomentum & eWIDMomentum(const unsigned int id)
Set the momentum of the indicated electroweak particle.
void finalize(XML::Element &elem)
Convert to XML.
LorentzMomentum & jetMomentum(const unsigned int id)
Set the momentum of the indicated jet.
ObjectProperties & fourEWIDProperties(const unsigned int id1, const unsigned int id2, const unsigned int id3, const unsigned int id4)
Four electroweak properties.
map< unsigned int, ObjectProperties > theEWIDProperties
Electroweak properties.