]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliTriggerScalersRecordESD.cxx
Keep products of decay(cascades) of primary particles on the stack.
[u/mrichter/AliRoot.git] / STEER / AliTriggerScalersRecordESD.cxx
CommitLineData
0bf41faa 1/*************************************************************************\r
56413996 2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *\r
3* *\r
4* Author: The ALICE Off-line Project. *\r
5* Contributors are mentioned in the code where appropriate. *\r
6* *\r
7* Permission to use, copy, modify and distribute this software and its *\r
8* documentation strictly for non-commercial purposes is hereby granted *\r
9* without fee, provided that the above copyright notice appears in all *\r
10* copies and that both the copyright notice and this permission notice *\r
11* appear in the supporting documentation. The authors make no claims *\r
12* about the suitability of this software for any purpose. It is *\r
0bf41faa 13* provided "as is" without express or implied warranty. * \r
14**************************************************************************/\r
56413996 15\r
16\r
17#include <Riostream.h>\r
18#include <TObjArray.h>\r
435919c9 19#include <AliTimeStamp.h>\r
56413996 20#include "AliLog.h" \r
21#include "AliTriggerScalersESD.h"\r
22#include "AliTriggerScalersRecordESD.h"\r
23\r
24ClassImp( AliTriggerScalersRecordESD )\r
25//_____________________________________________________________________________\r
26AliTriggerScalersRecordESD::AliTriggerScalersRecordESD():\r
0bf41faa 27TObject(),\r
435919c9 28fTimestamp(),\r
56413996 29fScalers()\r
30{\r
31}\r
32\r
33//_____________________________________________________________________________\r
34void AliTriggerScalersRecordESD::AddTriggerScalers( AliTriggerScalersESD* scaler ) \r
35{ \r
36 fScalers.AddLast( scaler ); \r
37}\r
38\r
39//_____________________________________________________________________________\r
40void AliTriggerScalersRecordESD::AddTriggerScalers( UChar_t classIndex, ULong64_t LOCB, ULong64_t LOCA, \r
41 ULong64_t L1CB, ULong64_t L1CA, ULong64_t L2CB, ULong64_t L2CA )\r
42{\r
43 AddTriggerScalers( new AliTriggerScalersESD( classIndex, LOCB, LOCA, L1CB, L1CA, L2CB, L2CA ) );\r
44} \r
45\r
0bf41faa 46//_____________________________________________________________________________\r
47AliTriggerScalersRecordESD::AliTriggerScalersRecordESD( const AliTriggerScalersRecordESD &rec ) :\r
48TObject(rec),\r
435919c9 49fTimestamp(rec.fTimestamp),\r
0bf41faa 50fScalers()\r
51{\r
435919c9 52//copy constructor\r
0bf41faa 53for (Int_t i = 0; i < rec.fScalers.GetEntriesFast(); i++) {\r
54 if (rec.fScalers[i]) fScalers.Add(rec.fScalers[i]->Clone());\r
55 }\r
56}\r
57//_____________________________________________________________________________\r
58AliTriggerScalersRecordESD& AliTriggerScalersRecordESD:: operator=(const AliTriggerScalersRecordESD& rec)\r
59{\r
435919c9 60//asignment operator\r
0bf41faa 61if(&rec == this) return *this;\r
62((TObject *)this)->operator=(rec);\r
435919c9 63fTimestamp=rec.fTimestamp;\r
0bf41faa 64for (Int_t i = 0; i < rec.fScalers.GetEntriesFast(); i++) {\r
65 if (rec.fScalers[i]) fScalers.Add(rec.fScalers[i]->Clone());\r
66 }\r
67\r
68return *this;\r
69} \r
70\r
71//_____________________________________________________________________________\r
72void AliTriggerScalersRecordESD::Reset()\r
73{\r
74fScalers.SetOwner();\r
75fScalers.Clear();\r
76} \r
77\r
56413996 78//_____________________________________________________________________________\r
b69ed284 79const AliTriggerScalersESD* AliTriggerScalersRecordESD::GetTriggerScalersForClass( const Int_t classindex ) const\r
56413996 80{\r
81 // Find Trigger scaler with class ID = classmask using a binary search. \r
82\r
83 Int_t base, last;\r
84 AliTriggerScalersESD *op2 = NULL;\r
85 \r
86 base = 0;\r
87 last = fScalers.GetEntriesFast();\r
88\r
89 while (base < last) {\r
90 op2 = (AliTriggerScalersESD *)fScalers.At(base);\r
91 if( op2->GetClassIndex() == classindex ) return op2;\r
92 base++;\r
93 }\r
94 return op2; \r
95}\r
96 \r
97//_____________________________________________________________________________\r
98void AliTriggerScalersRecordESD::Print( const Option_t* ) const\r
99{\r
100 // Print\r
101 cout << "Trigger Scalers Record: " << endl;\r
102 for( Int_t i=0; i<fScalers.GetEntriesFast(); ++i ) \r
103 ((AliTriggerScalersESD*)fScalers.At(i))->Print();\r
104}\r