CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/SimG4CMS/Calo/interface/HcalTestAnalysis.h

Go to the documentation of this file.
00001 #ifndef SimG4CMS_HcalTestAnalysis_H
00002 #define SimG4CMS_HcalTestAnalysis_H
00003 
00004 // File: HcalTestAnalysis.h
00005 // Analysis of simhits inside the OSCAR framework
00007 
00008 #include "SimG4Core/Notification/interface/Observer.h"
00009 #include "SimG4Core/Watcher/interface/SimWatcher.h"
00010 
00011 #include "SimDataFormats/CaloHit/interface/CaloHit.h"
00012 #include "SimDataFormats/CaloTest/interface/HcalTestHistoClass.h"
00013 #include "SimG4CMS/Calo/interface/HcalQie.h"
00014 #include "SimG4CMS/Calo/interface/HcalTestHistoManager.h"
00015 #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"
00016 #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h"
00017 
00018 #include <iostream>
00019 #include <memory>
00020 #include <vector>
00021 #include <string>
00022 
00023 
00024 class G4Step;
00025 class BeginOfJob;
00026 class BeginOfRun;
00027 class BeginOfEvent;
00028 class EndOfEvent;
00029 
00030 class HcalTestAnalysis : public SimWatcher,
00031                          public Observer<const BeginOfJob *>, 
00032                          public Observer<const BeginOfRun *>, 
00033                          public Observer<const BeginOfEvent *>, 
00034                          public Observer<const EndOfEvent *>, 
00035                          public Observer<const G4Step *> {
00036 
00037 public:
00038   HcalTestAnalysis(const edm::ParameterSet &p);
00039   virtual ~HcalTestAnalysis();
00040 
00041 private:
00042   // observer classes
00043   void update(const BeginOfJob * run);
00044   void update(const BeginOfRun * run);
00045   void update(const BeginOfEvent * evt);
00046   void update(const EndOfEvent * evt);
00047   void update(const G4Step * step);
00048 
00049   // analysis-related stuff
00050   std::vector<int> layerGrouping(int);
00051   std::vector<int> towersToAdd(int centre, int nadd);
00052   void   fill(const EndOfEvent * ev);
00053   void   qieAnalysis();
00054   void   layerAnalysis();
00055   double timeOfFlight(int det, int layer, double eta);
00056 
00057 private:
00058 
00059   //Keep parameters to instantiate HcalTestHistoClass later
00060   std::string               fileName;
00061 
00062   // Qie Analysis
00063   HcalQie *                 myqie;
00064   int                       addTower;
00065 
00066   // Private Tuples
00067   std::auto_ptr<HcalTestHistoManager>    tuplesManager;
00068   HcalTestHistoClass   *    tuples;
00069 
00070   // Numbering scheme
00071   HcalNumberingFromDDD *    numberingFromDDD;
00072   HcalTestNumberingScheme * org;
00073 
00074   // Hits for qie analysis
00075   std::vector<CaloHit>      caloHitCache; 
00076   std::vector<int>          group_, tower_;
00077   int                       nGroup, nTower;
00078   
00079   // to read from ParameterSet
00080   std::vector<std::string>  names;
00081   double                    eta0, phi0;
00082   int                       centralTower;
00083 
00084   // some private members for ananlysis 
00085   unsigned int              count;                  
00086   double                    edepEB, edepEE, edepHB, edepHE, edepHO;
00087   double                    edepl[20];
00088   double                    mudist[20];   // Distance of muon from central part
00089 };
00090 
00091 #endif