]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliNanoAODStorage.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / AOD / AliNanoAODStorage.h
1 #ifndef _ALINANOAODSTORAGE_H_
2 #define _ALINANOAODSTORAGE_H_
3
4
5 //-------------------------------------------------------------------------
6 //  AliNanoAODStorage
7 //
8 //  Implements the storage for special AOD classes 
9 //
10 //-------------------------------------------------------------------------
11 #include <iostream>
12 #include "TObject.h"
13 #include "AliLog.h"
14
15
16 class AliNanoAODStorage  {
17
18 public:
19   AliNanoAODStorage():fNVars(0), fVars(0) {;}
20   virtual ~AliNanoAODStorage() {;};
21
22   AliNanoAODStorage& operator=(const AliNanoAODStorage& sto);
23
24   void AllocateInternalStorage(Int_t size);
25   void SetVar(Int_t index, Double_t var) { 
26     if(index>=0 && index < fNVars)  fVars[index] = var;  
27     else AliFatal(Form("Variable %d not included in this special aod", index));
28   }
29   Double_t GetVar(Int_t index)  const {
30     if(index>=0 && index < fNVars) return fVars[index]; 
31     AliFatal(Form("Variable %d not included in this special aod", index));
32     return 0;}
33   virtual const char *ClassName() const {return "AliNanoAODStorage";} // Needed for alifatal. The class cannot inherit from TObject, otherwise we mix (and mess up) inheritance in the track, as it also inherits from AliVTrack which inherits from TObject.
34
35 protected:
36
37   Int_t    fNVars;     // Number of kimematic variables, set by constructor
38   std::vector<Double32_t> fVars; // Array of kinematic vars. Here we use an STL vector because it produces ~5% smaller files. It may be aslo splittable
39
40   ClassDef(AliNanoAODStorage, 1)
41 };
42
43
44
45 #endif /* _ALINANOAODSTORAGE_H_ */