This avoids problems when switching file (the mapping would be deleted).
The AliNanoAODTrack track class now has a Clear method.
//_______________________________________________________
+
+void AliNanoAODTrack::Clear(Option_t * /*opt*/) {
+ // empty storage
+ fVars.clear();
+ fNVars = 0;
+}
AliNanoAODTrack(const AliNanoAODTrack& trk);
AliNanoAODTrack& operator=(const AliNanoAODTrack& trk);
- // Storage helper methods
+
+ virtual void Clear(Option_t * opt) ;
// kinematics
virtual Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : -999.; }
private :
- // Remove everything from here on?
// Momentum & position
// FIXME: the following was replaced by posx, posy, posz. Check if the names make sense
if(tree) {
tree->GetUserInfo()->Print();
- fInstance = (AliNanoAODTrackMapping*) tree->GetUserInfo()->FindObject("AliNanoAODTrackMapping");
+ fInstance = new AliNanoAODTrackMapping(*((AliNanoAODTrackMapping*) tree->GetUserInfo()->FindObject("AliNanoAODTrackMapping")));
// Otherwise try to get it from the current directory
std::cout << " from tree: " << fInstance << std::endl;
static AliNanoAODTrackMapping * fInstance; //instance, needed for the singleton implementation
static TString fMappingString; // the string which this class was initialized with
- std::map<TString,int> fMapCstVar;// Map of indexes of custom variables: CASH THIS TO CONST INTs IN YOUR TASK TO AVOID CONTINUOUS STRING COMPARISONS
+ std::map<TString,int> fMapCstVar;// Map of indexes of custom variables: CACHE THIS TO CONST INTs IN YOUR TASK TO AVOID CONTINUOUS STRING COMPARISONS
ClassDef(AliNanoAODTrackMapping, 1)
};