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 
00019 class TEventList;
00020 class QCoincidence;
00021 
00022 
00023 class QCoProjector
00024 {
00025 
00026 
00027 public:
00028   QCoProjector ();
00029   virtual ~QCoProjector ();
00030 
00031   //* @brief Set coincidences
00032   void SetCoincidences (const std::list<QCoincidence>& coincidences); 
00033 
00035   const std::list<QCoincidence>& GetCoincidences() const
00036    { return fCoincidences; }
00037 
00038   //* @brief Return Events in fCoincidences in form of root TEventlist,
00039   //   that can be used to filter a diana tree 
00040   TEventList * GetEventList ();
00041 
00042   //* @brief Projects arg variables in internal arrays in Event-based way
00043   //   arg: Root syntaxis, by now, 1 or two arguments, separated by : 
00044   //   Consider only events in evList
00045   //   To recover arrays, do this->GetV1(), this->GetV2() 
00046   //   Beware these arrays will be overwritten by the next call to Project...
00047   //   If an eventList is given, only this events will be considered
00048   //   Return the number of projected events
00049   int ProjectEventBased (std::string arg, TEventList * evList=0);
00050 
00051   //* @brief Projects arg variables in internal arrays in Co-based way
00052   //   arg: Root syntaxis, by now, 1 or two arguments, separated by : 
00053   //   To recover arrays, do this->GetV1(), this->GetV2() 
00054   //   Beware these arrays will be overwritten by the next call to Project...
00055   void ProjectCoBased (std::string arg);
00056 
00057   //* @brief Return pointers to internals arrays with projected variables
00058   //   Beware these arrays will be overwritten by the next call to Project...
00059   double * GetV1() {return fV1;}
00060   double * GetV2() {return fV2;}
00061   int GetNEvents() {if (fRegenerateEventList) RegenerateEventList(); return fNEvents;}
00062   int GetNCoincidences() {if (fRegenerateEventList) RegenerateEventList(); return fNCoincidences;}
00063 
00064 protected:
00065   std::list<QCoincidence> fCoincidences;
00066   QCoSelector fSelector;
00067   TEventList * fEventList; 
00068   bool fRegenerateEventList;
00069   int fNEvents;
00070   int fNCoincidences; 
00071   double * fV1;
00072   double * fV2;
00073 
00074 
00075   // Auxiliar
00076 protected:
00077   void RegenerateEventList();
00078   void CreateArrays();
00079   std::vector<std::string> ScanArg(std::string arg, int &narg);
00080 };
00081 
00082 #endif
00083 
00084 

Generated on Fri Mar 6 13:40:39 2009 for CUORE Software by  doxygen 1.5.1