Line data Source code
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 "TObject.h"
12 :
13 :
14 0 : class AliNanoAODStorage {
15 :
16 : public:
17 0 : AliNanoAODStorage():fNVars(0), fVars(0) {;}
18 0 : virtual ~AliNanoAODStorage() {fVars.clear();};
19 :
20 : AliNanoAODStorage& operator=(const AliNanoAODStorage& sto);
21 :
22 : void AllocateInternalStorage(Int_t size);
23 : void SetVar(Int_t index, Double_t var) {
24 0 : if(index>=0 && index < fNVars) fVars[index] = var;
25 0 : else Complain(index);
26 0 : }
27 : Double_t GetVar(Int_t index) const {
28 0 : if(index>=0 && index < fNVars) return fVars[index];
29 0 : Complain(index);
30 0 : return 0;}
31 0 : 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.
32 :
33 : protected:
34 :
35 : Int_t fNVars; // Number of kimematic variables, set by constructor
36 : 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
37 :
38 170 : ClassDef(AliNanoAODStorage, 1)
39 : private:
40 : void Complain(Int_t index) const;
41 : };
42 :
43 :
44 :
45 : #endif /* _ALINANOAODSTORAGE_H_ */
|