Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:41

0001 #ifndef Analysis_Main_Primitive_Analysis_H
0002 #define Analysis_Main_Primitive_Analysis_H
0003 
0004 #include <vector>
0005 
0006 #include "ATOOLS/Phys/Particle_List.H"
0007 #include "ATOOLS/Phys/Blob_List.H"
0008 #include "ATOOLS/Phys/Blob.H"
0009 #include "ATOOLS/Org/File_IO_Base.H"
0010 
0011 namespace ATOOLS {
0012   class Particle_Qualifier_Base;
0013   class NLO_subevt;
0014 }
0015 
0016 namespace ANALYSIS {
0017 
0018   const static std::string finalstate_list("FinalState");
0019 
0020   enum code {
0021 
0022     splitt_jetseeds = 2,
0023     splitt_process  = 4,
0024     splitt_all      = 6,
0025     fill_histos     = 8,
0026     fill_helper     = 16,
0027     fill_all        = 24,
0028     
0029     output_this     = 128,
0030     output_jet      = 256,
0031     output_process  = 512,
0032     
0033     do_me           = 1024,
0034     do_mi           = 2048,
0035     do_shower       = 4096,
0036     do_hadron       = 8192,
0037     splitt_phase    = 16384,
0038     split_sh        = 32768,
0039     do_menlo        = 65536,
0040     split_vars      = 131072
0041   };
0042 
0043   class Analysis_Object;
0044   class Analysis_Handler;
0045   class Primitive_Analysis;
0046 
0047   typedef std::vector<Analysis_Object*>                 Object_List;
0048   typedef std::map<std::string,ATOOLS::Particle_List*>  PL_Container;
0049   typedef std::map<std::string,Primitive_Analysis *>    Analysis_List;
0050 
0051   class Primitive_Analysis: public ATOOLS::File_IO_Base {
0052   private:
0053 
0054     int                     m_mode, m_varid;
0055     bool                    m_hasvar;
0056     ATOOLS::Variations_Type m_vartype;  //!< undefined iff `m_varid == 0`
0057     bool                    m_usedb;
0058     long                    m_nevt;
0059     std::string             m_name, m_maxjettag;
0060 
0061     Object_List            m_objects;
0062     PL_Container           m_pls, m_slp;
0063 
0064     std::set<Primitive_Analysis*> m_called;
0065 
0066     ATOOLS::String_BlobDataBase_Map m_datacontainer;
0067     Analysis_List          m_subanalyses;
0068 
0069     // reference to the event record
0070     const ATOOLS::Blob_List    * p_blobs;
0071 
0072     Primitive_Analysis   * p_partner;
0073 
0074     bool  m_active, m_splitjetconts;
0075 
0076     Analysis_Handler *p_ana;
0077 
0078     ATOOLS::NLO_subevt *p_sub, *p_real;
0079 
0080     std::string JetID(std::string name,std::string max) const;
0081     
0082     void Init();
0083     bool SelectBlob(const ATOOLS::Blob *blob); 
0084     void CreateFinalStateParticleList();
0085 
0086     Primitive_Analysis * GetSubAnalysis(const ATOOLS::Blob_List *const bl,
0087                     const std::string & key, int mode,int master=true);
0088     void CallSubAnalysis(const ATOOLS::Blob_List * const bl, double value);
0089 
0090     void PrintStatus();
0091 
0092   public :
0093 
0094     Primitive_Analysis(Analysis_Handler *const ana,const int);
0095     Primitive_Analysis(Analysis_Handler *const ana,const std::string, const int);
0096 
0097     ~Primitive_Analysis();
0098     
0099     void DoAnalysis(const ATOOLS::Blob_List * const , double);
0100     bool DoAnalysisNLO(const ATOOLS::Blob_List * const , const double);
0101     void FinishAnalysis(const std::string &,int mode);
0102     void RestoreAnalysis();
0103     
0104     void AddObject(Analysis_Object *obj);
0105     Analysis_Object *GetObject(const std::string & key);
0106 
0107     void AddParticleList(const std::string &,ATOOLS::Particle_List *);
0108     ATOOLS::Particle_List * GetParticleList(const std::string &,
0109                         const bool=false);
0110 
0111     ATOOLS::Blob_Data_Base * operator[](const std::string name);
0112     void AddData(const std::string name,ATOOLS::Blob_Data_Base * data); 
0113 
0114     void ClearAllData();
0115 
0116     void SetPartner(Primitive_Analysis * const);
0117     void SetBlobType(const std::string &);
0118     int  NumberOfObjects() { return m_objects.size(); }
0119 
0120     void Test(const int mode=0);
0121     
0122     // inline methods
0123     inline void SetMaxJetTag(const std::string &tag) { m_maxjettag=tag; }
0124     inline void SetSplitJetConts(bool tag) { m_splitjetconts=tag; }
0125 
0126     inline const std::string &Name() const { return m_name; }
0127     inline int                Mode() const { return m_mode; }
0128 
0129     inline const ATOOLS::String_BlobDataBase_Map &GetData()
0130     { return m_datacontainer; }
0131 
0132     inline Analysis_Handler *AnalysisHandler() const { return p_ana; }
0133 
0134     inline ATOOLS::NLO_subevt *Sub() const { return p_sub; }
0135     inline ATOOLS::NLO_subevt *Real() const { return p_real; }
0136 
0137     inline void SetVarId(const int &id) { m_varid=id; }
0138     inline const int &VarId() const { return m_varid; }
0139 
0140     inline void SetVarType(const ATOOLS::Variations_Type &type) { m_vartype=type; }
0141     inline const ATOOLS::Variations_Type &VarType() const { return m_vartype; }
0142 
0143     inline void SetUseDB(const bool &usedb) { m_usedb=usedb; }
0144 
0145     inline const ATOOLS::Blob_List *GetBlobList() { return p_blobs; }
0146 
0147   };// end of class Primitive_Analysis
0148 
0149 }// end of namespace ANALYSIS
0150 
0151 #endif