QCoProjector.hh

Go to the documentation of this file.
00001 
00002 #ifndef _Q_COPROJECTER_HH_
00003 #define _Q_COPROJECTER_HH_
00004 
00005 #include <vector>
00006 #include <list>
00007 #include <string>
00008 #include <QCoSelector.hh>
00009 
00010 class QCoincidence;
00011 class TNtupleD;
00012 
00020 class TEventList;
00021 class QCoincidence;
00022 
00023 
00024 class QCoProjector
00025 {
00026 
00027 
00028 public:
00029   QCoProjector ();
00030   virtual ~QCoProjector ();
00031 
00032   //* @brief Set coincidences
00033   void SetCoincidences (const std::list<QCoincidence>& coincidences, std::string basename = "tree");
00034 
00035 
00037   const std::list<QCoincidence>& GetCoincidences() const
00038   { return fCoincidences; }
00039 
00040   //* @brief Return Events in fCoincidences in form of root TEventlist,
00041   //   that can be used to filter a diana tree 
00042   //TEventList * GetEventList ();
00043 
00044   //* @brief Projects arg variables in internal arrays in Event-based way
00045   //   arg: Root syntaxis, by now, 1 or two arguments, separated by : 
00046   //   Consider only events in evList
00047   //   To recover arrays, do this->GetV1(), this->GetV2() 
00048   //   Beware these arrays will be overwritten by the next call to Project...
00049   //   If an eventList is given, only this events will be considered
00050   //   Return the number of projected events
00051   int ProjectEventBased (std::string arg, TEventList * evList=0);
00052 
00053   //* @brief Projects arg variables in internal arrays in Co-based way
00054   //   arg: Root syntaxis, by now, 1 or two arguments, separated by : 
00055   //   To recover arrays, do this->GetV1(), this->GetV2() 
00056   //   Beware these arrays will be overwritten by the next call to Project...
00057   void ProjectCoBased (std::string arg);
00058 
00059   //* @brief Return pointers to internals arrays with projected variables
00060   //   Beware these arrays will be overwritten by the next call to Project...
00061   double * GetV1() {return fV1;}
00062   double * GetV2() {return fV2;}
00063   //int GetNEvents() {if (fRegenerateEventList) RegenerateEventList(); return fNEvents;}
00064   int GetNEvents() {return fNEvents;}
00065   //int GetNCoincidences() {if (fRegenerateEventList) RegenerateEventList(); return fNCoincidences;}
00066   int GetNCoincidences() {return fNCoincidences;}
00067 
00068   /* @brief Dumps an event list, with the same format as MCoincidenceTester method
00069    * The first line in the output is a comment line
00070    * All others lines represent an event. Each line has the following fields:
00071    * - CoincidenceId [int]                  : counter
00072    * - EventTime     [unsigned long long]   : time in ns since 1970-1-1
00073    * - ChannelId     [int]                  : event channel 
00074    * - Energy        [double]               : energy of the event in MeV
00075    */
00076   void DumpCoincidenceList (const char * fileName); 
00077   
00078   /* @brief Return pointers to coincidence trees
00079    */
00080   TNtupleD * GetEventBasedCoin() {return fEventBasedCoin;}
00081   TNtupleD * GetCoBasedCoin() {return fCoBasedCoin;}
00082 
00083 
00084 protected:
00085   std::list<QCoincidence> fCoincidences;
00086   TNtupleD * fEventBasedCoin;
00087   TNtupleD * fCoBasedCoin;
00088   QCoSelector fSelector;
00089   //TEventList * fEventList; 
00090   bool fRegenerateEventList;
00091   int fNEvents;
00092   int fNCoincidences; 
00093   double * fV1;
00094   double * fV2;
00095 
00096 
00097   // Auxiliar
00098 protected:
00099   //void RegenerateEventList();
00100   void CreateArrays();
00101   std::vector<std::string> ScanArg(std::string arg, int &narg);
00102 };
00103 
00104 #endif
00105 
00106 

Generated on Tue Nov 16 10:49:55 2010 for CUORE Software by  doxygen 1.5.6