QApolloOptimumTrigger.hh

00001 /* Cuore Reconstruction program
00002  *
00003  * Author: MP 31/07/06
00004  * $Id: QApolloOptimumTrigger.hh 62 2006-05-05 13:46:36Z pallas $
00005  *
00006  * Class QApolloOptimumTrigger
00007  * Threshold Trigger class for Cuore 
00008  * Very simple triggering algorythm. A trigger is generated when the signal is above a threhsold
00009  * over the average baseline for a certain number of consecutive samples. Both the baseline and
00010  * the sigma noise can be fixed or auto-calculated during data taking
00011  * The first sample of the group that triggers is tagged.
00012  *
00013  */
00014 
00015 #ifndef _Q_APOLLO_OPTIMUM_TRIGGER_H_
00016 #define _Q_APOLLO_OPTIMUM_TRIGGER_H_
00017 
00018 #include "QApolloTrigger.hh"
00019 #include "QOTFilter.hh"
00020 #include "QOTTrigger.hh"
00021 #include "QVectorR.hh"
00022 #include <TFile.h>
00023 #include <TTree.h>
00024 #include <fstream>
00025 using namespace Cuore;
00026 
00027 class QApolloOptimumTrigger : public QApolloTrigger {
00028 
00029 public:
00030 
00031   // ctor
00032   QApolloOptimumTrigger(QCrateReceiverBuffer &b,unsigned int);
00033 
00034   // dtor
00035   virtual ~QApolloOptimumTrigger();
00036 
00037   // search for triggers
00038   virtual int SearchForTrigger(int);
00039   
00040   // self adjust
00041   bool SelfAdjust(int);
00042 
00043 private:
00044 
00045   double fThresholdFactor;
00046   bool fDiff;
00047   std::string fAvgPulseFile;
00048   std::string fAvgNoiseFile;
00049   std::string fKernelWindow;
00050 
00051   unsigned int fPreWords;
00052   unsigned int fPreFilled;
00053   bool fReady2Trg;
00054 
00055   int fFWHM;
00056   QFFT::WindowType fKernelWindowType;
00057   QOTFilter fOTF;
00058   QOTTrigger fOTT;
00059   Cuore::QVector fInput, fFiltered, fTriggers, fAmplTriggers, fChiSquares, fPSADelays, fPSAAmpls;
00060   std::vector<QVector> fPeaks, fFitFunctions;
00061 
00062   
00063   TFile *fRootOutputFile;
00064   TTree* fTree;
00065   int fRunNumber;
00066   double fAmpl;
00067   double fChi;
00068   QVectorR* fPeak;
00069   QVectorR* fFitFunction;
00070   double fPSADelay;
00071   double fPSAAmpl;
00072   unsigned int fcounter; //needed to sync outputfile
00073 
00074   bool fDebugMode;
00075 
00076   bool fSaveLogFile;
00077   std::ofstream fLogFile;
00078   
00079 };
00080 
00081 #endif

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