]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROTriggerSimulator.h
Adding methods to calculate the number of trigger flags on each side and fill the...
[u/mrichter/AliRoot.git] / VZERO / AliVZEROTriggerSimulator.h
index 3d3ea921a7130959a00d92802096322324c1f85b..007c1caf0d69158192648393dfc7695d3ca14080 100644 (file)
-#ifndef ALIVZEROTRIGGERSIMULATOR_H
-#define ALIVZEROTRIGGERSIMULATOR_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
- * reserved. 
- *
- * See cxx source for full Copyright notice                               
- */
-
-#include <TObject.h>
-
-#include "AliVZEROTriggerData.h"
-
-class AliVZEROLogicalSignal;
-class TTree;
-class TClonesArray;
-
-class AliVZEROTriggerSimulator : public TObject {
-public:
-       AliVZEROTriggerSimulator();
-       AliVZEROTriggerSimulator(TTree * digitsTree, TClonesArray* digits);
-       ~AliVZEROTriggerSimulator();
-       AliVZEROTriggerSimulator(const AliVZEROTriggerSimulator &triggerSim);
-       AliVZEROTriggerSimulator& operator= (const AliVZEROTriggerSimulator &triggerSim);
-       
-       AliVZEROTriggerData * GetTriggerData() const {return fTriggerData;};
-       
-       Bool_t GetBBAandBBC() const             {return (fTriggerWord & 0x1);};
-       Bool_t GetBBAorBBC() const              {return (fTriggerWord>>1 & 0x1);};
-       Bool_t GetBGAandBBC() const             {return (fTriggerWord>>2 & 0x1);};
-       Bool_t GetBGA() const                   {return (fTriggerWord>>3 & 0x1);};
-       Bool_t GetBGCandBBA() const             {return (fTriggerWord>>4 & 0x1);};
-       Bool_t GetBGC() const                   {return (fTriggerWord>>5 & 0x1);};
-       Bool_t GetCTA1andCTC1() const   {return (fTriggerWord>>6 & 0x1);};
-       Bool_t GetCTA1orCTC1() const    {return (fTriggerWord>>7 & 0x1);};
-       Bool_t GetCTA2andCTC2() const   {return (fTriggerWord>>8 & 0x1);};
-       Bool_t GetCTA2orCTC2() const    {return (fTriggerWord>>9 & 0x1);};
-       Bool_t GetMTAandMTC() const             {return (fTriggerWord>>10 & 0x1);};
-       Bool_t GetMTAorMTC() const              {return (fTriggerWord>>11 & 0x1);};
-       Bool_t GetBBA() const                   {return (fTriggerWord>>12 & 0x1);};
-       Bool_t GetBBC() const                   {return (fTriggerWord>>13 & 0x1);};
-       Bool_t GetBGAorBGC() const              {return (fTriggerWord>>14 & 0x1);};
-       Bool_t GetBeamGas() const               {return (fTriggerWord>>15 & 0x1);};
-       
-       void SetBBAandBBC()             { (fTriggerWord += 0x1);};
-       void SetBBAorBBC()              { (fTriggerWord += 0x1<<1);};
-       void SetBGAandBBC()             { (fTriggerWord += 0x1<<2);};
-       void SetBGA()                   { (fTriggerWord += 0x1<<3);};
-       void SetBGCandBBA()             { (fTriggerWord += 0x1<<4);};
-       void SetBGC()                   { (fTriggerWord += 0x1<<5);};
-       void SetCTA1andCTC1()   { (fTriggerWord += 0x1<<6);};
-       void SetCTA1orCTC1()    { (fTriggerWord += 0x1<<7);};
-       void SetCTA2andCTC2()   { (fTriggerWord += 0x1<<8);};
-       void SetCTA2orCTC2()    { (fTriggerWord += 0x1<<9);};
-       void SetMTAandMTC()             { (fTriggerWord += 0x1<<10);};
-       void SetMTAorMTC()              { (fTriggerWord += 0x1<<11);};  
-       void SetBBA()                   { (fTriggerWord += 0x1<<12);};
-       void SetBBC()                   { (fTriggerWord += 0x1<<13);};
-       void SetBGAorBGC()              { (fTriggerWord += 0x1<<14);};
-       void SetBeamGas()               { (fTriggerWord += 0x1<<15);};
-       
-       void Run();
-       
-private:
-       // Private methods
-       AliVZEROTriggerData * LoadTriggerData() const ;
-       void GenerateBBWindows();
-       void GenerateBGWindows();
-       
-       // Members
-       AliVZEROLogicalSignal * fBBGate[AliVZEROTriggerData::kNCIUBoards];
-       AliVZEROLogicalSignal * fBBLatch[AliVZEROTriggerData::kNCIUBoards];
-       AliVZEROLogicalSignal * fBBReset[AliVZEROTriggerData::kNCIUBoards];
-       
-       AliVZEROLogicalSignal * fBGGate[AliVZEROTriggerData::kNCIUBoards];
-       AliVZEROLogicalSignal * fBGLatch[AliVZEROTriggerData::kNCIUBoards];
-       AliVZEROLogicalSignal * fBGReset[AliVZEROTriggerData::kNCIUBoards];
-
-       AliVZEROTriggerData *fTriggerData; // Object holding the trigger configuration parameters
-       
-       TTree* fDigitsTree;
-       TClonesArray* fDigits;
-       
-       Bool_t fBBFlags[64];
-       Bool_t fBGFlags[64];
-       Int_t  fCharges[64];
-       
-       UShort_t fTriggerWord;
-               
-       ClassDef( AliVZEROTriggerSimulator, 1 )  
-
-};
-
-
-#endif // ALIVZEROTRIGGERSIMULATOR_H
+#ifndef ALIVZEROTRIGGERSIMULATOR_H\r
+#define ALIVZEROTRIGGERSIMULATOR_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights\r
+ * reserved. \r
+ *\r
+ * See cxx source for full Copyright notice                               \r
+ */\r
+// \r
+// Class AliVZEROTriggerSimulator\r
+// ------------------------------\r
+//  Simulate the VZERO Trigger response\r
+// Use FEE parameters stored in Database\r
+// Can work on real data or in simulation\r
+//\r
+\r
+#include <TObject.h>\r
+\r
+#include "AliVZEROTriggerData.h"\r
+\r
+class AliVZEROLogicalSignal;\r
+class TTree;\r
+class TClonesArray;\r
+\r
+class AliVZEROTriggerSimulator : public TObject {\r
+public:\r
+       AliVZEROTriggerSimulator();\r
+       AliVZEROTriggerSimulator(TTree * digitsTree, TClonesArray* digits);\r
+       ~AliVZEROTriggerSimulator();\r
+       \r
+       AliVZEROTriggerData * GetTriggerData() const {return fTriggerData;};\r
+       \r
+       Bool_t GetBBAandBBC() const             {return (fTriggerWord & 0x1);};\r
+       Bool_t GetBBAorBBC() const              {return (fTriggerWord>>1 & 0x1);};\r
+       Bool_t GetBGAandBBC() const             {return (fTriggerWord>>2 & 0x1);};\r
+       Bool_t GetBGA() const                   {return (fTriggerWord>>3 & 0x1);};\r
+       Bool_t GetBGCandBBA() const             {return (fTriggerWord>>4 & 0x1);};\r
+       Bool_t GetBGC() const                   {return (fTriggerWord>>5 & 0x1);};\r
+       Bool_t GetCTA1andCTC1() const   {return (fTriggerWord>>6 & 0x1);};\r
+       Bool_t GetCTA1orCTC1() const    {return (fTriggerWord>>7 & 0x1);};\r
+       Bool_t GetCTA2andCTC2() const   {return (fTriggerWord>>8 & 0x1);};\r
+       Bool_t GetCTA2orCTC2() const    {return (fTriggerWord>>9 & 0x1);};\r
+       Bool_t GetMTAandMTC() const             {return (fTriggerWord>>10 & 0x1);};\r
+       Bool_t GetMTAorMTC() const              {return (fTriggerWord>>11 & 0x1);};\r
+       Bool_t GetBBA() const                   {return (fTriggerWord>>12 & 0x1);};\r
+       Bool_t GetBBC() const                   {return (fTriggerWord>>13 & 0x1);};\r
+       Bool_t GetBGAorBGC() const              {return (fTriggerWord>>14 & 0x1);};\r
+       Bool_t GetBeamGas() const               {return (fTriggerWord>>15 & 0x1);};\r
+       \r
+       void SetBBAandBBC()             { (fTriggerWord += 0x1);};\r
+       void SetBBAorBBC()              { (fTriggerWord += 0x1<<1);};\r
+       void SetBGAandBBC()             { (fTriggerWord += 0x1<<2);};\r
+       void SetBGA()                   { (fTriggerWord += 0x1<<3);};\r
+       void SetBGCandBBA()             { (fTriggerWord += 0x1<<4);};\r
+       void SetBGC()                   { (fTriggerWord += 0x1<<5);};\r
+       void SetCTA1andCTC1()   { (fTriggerWord += 0x1<<6);};\r
+       void SetCTA1orCTC1()    { (fTriggerWord += 0x1<<7);};\r
+       void SetCTA2andCTC2()   { (fTriggerWord += 0x1<<8);};\r
+       void SetCTA2orCTC2()    { (fTriggerWord += 0x1<<9);};\r
+       void SetMTAandMTC()             { (fTriggerWord += 0x1<<10);};\r
+       void SetMTAorMTC()              { (fTriggerWord += 0x1<<11);};  \r
+       void SetBBA()                   { (fTriggerWord += 0x1<<12);};\r
+       void SetBBC()                   { (fTriggerWord += 0x1<<13);};\r
+       void SetBGAorBGC()              { (fTriggerWord += 0x1<<14);};\r
+       void SetBeamGas()               { (fTriggerWord += 0x1<<15);};\r
+       \r
+       void Run();\r
+       \r
+private:\r
+       // Private methods\r
+       AliVZEROTriggerSimulator(const AliVZEROTriggerSimulator &/*triggerSim*/);\r
+       AliVZEROTriggerSimulator& operator= (const AliVZEROTriggerSimulator & /*triggerSim*/);\r
+       AliVZEROTriggerData * LoadTriggerData() const ;\r
+       void                  LoadClockOffset();\r
+       void GenerateBBWindows();\r
+       void GenerateBGWindows();\r
+       \r
+       // Members\r
+       AliVZEROLogicalSignal * fBBGate[AliVZEROTriggerData::kNCIUBoards];  // BB Observation window\r
+       AliVZEROLogicalSignal * fBBLatch[AliVZEROTriggerData::kNCIUBoards]; // BB Latch window\r
+       AliVZEROLogicalSignal * fBBReset[AliVZEROTriggerData::kNCIUBoards]; // BB Reset Window\r
+       \r
+       AliVZEROLogicalSignal * fBGGate[AliVZEROTriggerData::kNCIUBoards];  // BG Observation window\r
+       AliVZEROLogicalSignal * fBGLatch[AliVZEROTriggerData::kNCIUBoards]; // BG Latch Window\r
+       AliVZEROLogicalSignal * fBGReset[AliVZEROTriggerData::kNCIUBoards]; // BG Reset Window\r
+\r
+       AliVZEROTriggerData *fTriggerData; // Object holding the trigger configuration parameters\r
+       Float_t fClockOffset[AliVZEROTriggerData::kNCIUBoards]; // TDC clock offset including roll-over, trig count and L0->L1 delay\r
+       \r
+       TTree* fDigitsTree; //Pointer to VZERO digit tree\r
+       TClonesArray* fDigits; //Pointer to VZERO digit array\r
+       \r
+       Bool_t fBBFlags[64]; // Individual BB Flags\r
+       Bool_t fBGFlags[64]; // Individual BG Flags\r
+       Float_t  fCharges[64]; // Individual Charge\r
+       \r
+       UShort_t fTriggerWord; // Word holding the 16 triggers return by the FEE\r
+               \r
+       ClassDef( AliVZEROTriggerSimulator, 3 )  \r
+\r
+};\r
+\r
+\r
+#endif // ALIVZEROTRIGGERSIMULATOR_H\r
+\r
+\r