New class with track point summary info (Ruben)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Apr 2012 22:56:27 +0000 (22:56 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Apr 2012 22:56:27 +0000 (22:56 +0000)
ITS/AliITSSumTP.cxx [new file with mode: 0644]
ITS/AliITSSumTP.h [new file with mode: 0644]
ITS/CMakelibITSrec.pkg
ITS/ITSrecLinkDef.h

diff --git a/ITS/AliITSSumTP.cxx b/ITS/AliITSSumTP.cxx
new file mode 100644 (file)
index 0000000..a31f016
--- /dev/null
@@ -0,0 +1,62 @@
+#include "AliITSSumTP.h"
+#include "AliTrackPointArray.h"
+
+///////////////////////////////////////////////////////////////////
+//                                                               //
+// Class for ITS trackpoints summary + some aux. info  )         //
+// Author: Ruben Shahoian                                        //
+//                                                               //
+///////////////////////////////////////////////////////////////////
+
+/* $Id$ */
+
+ClassImp(AliITSSumTP)
+
+//__________________________________________
+AliITSSumTP::AliITSSumTP(const AliITSSumTP& src) : 
+                  TObject(src), fTracks(src.fTracks.GetEntriesFast()), fVertex(src.GetVertex()), 
+                  fNVars(src.fNVars), fCrvVars(0)
+{
+  // copy c-tor
+  fCrvVars = new Double32_t[fNVars];
+  TObjArray& arrSrc = src.GetTracks();
+  for (int i=fNVars;i--;) fCrvVars[i] = src.fCrvVars[i];
+  for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
+}
+
+//__________________________________________
+AliITSSumTP& AliITSSumTP::operator=(const AliITSSumTP& src)
+{
+  // assignment op-r
+  if (this == &src) return *this;
+  Reset();
+  TObject::operator=(src);
+  fVertex = src.GetVertex();
+  fNVars = src.fNVars;
+  fCrvVars = new Double32_t[fNVars];
+  TObjArray& arrSrc = src.GetTracks();
+  for (int i=fNVars;i--;) fCrvVars[i] = src.fCrvVars[i];
+  for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
+  return *this;
+}
+
+//__________________________________________
+void AliITSSumTP::BookNTracks(Int_t n)
+{
+  // book space for tracks info
+  delete[] fCrvVars; 
+  fNVars = n*kNVarPerTrack; 
+  fCrvVars = fNVars>0 ? new Double32_t[fNVars] : 0;
+  for (int i=fNVars;i--;) fCrvVars[i]=0; 
+}
+
+//__________________________________________
+void AliITSSumTP::Reset()
+{
+  // reset object
+  fTracks.Delete();
+  delete[] fCrvVars; 
+  fCrvVars = 0;
+  fNVars = 0;
+  SetUniqueID(0);
+}
diff --git a/ITS/AliITSSumTP.h b/ITS/AliITSSumTP.h
new file mode 100644 (file)
index 0000000..f91b388
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef ALIITSSUMTP_H
+#define ALIITSSUMTP_H
+
+///////////////////////////////////////////////////////////////////
+//                                                               //
+// Class for ITS trackpoints summary + some aux. info  )         //
+// Author: Ruben Shahoian                                        //
+//                                                               //
+///////////////////////////////////////////////////////////////////
+
+/* $Id$ */
+
+class AliTrackPointArray;
+#include <TObjArray.h>
+#include "AliESDVertex.h"
+
+class AliITSSumTP : public TObject
+{
+ public:
+  enum {kCrvTPC,kCrvTPCErr,kCrvGlo,kCrvGloErr,kNVarPerTrack};
+  //
+  AliITSSumTP() : fTracks(0),fVertex(),fNVars(0),fCrvVars(0) {fTracks.SetOwner(kTRUE);}
+  AliITSSumTP(const AliITSSumTP& src);
+  virtual ~AliITSSumTP() {Reset();}
+  AliITSSumTP &operator=(const  AliITSSumTP& src);
+  //
+  AliESDVertex& GetVertex()             const {return (AliESDVertex&)fVertex;}
+  AliTrackPointArray* GetTrack(Int_t i) const {return (AliTrackPointArray*)fTracks[i];}
+  TObjArray&   GetTracks()              const {return (TObjArray&) fTracks;}
+  Int_t        GetNTracks()             const {return fNVars/kNVarPerTrack;}
+  Double_t     GetCrvTPC(Int_t i)       const {return fCrvVars[i*kNVarPerTrack+kCrvTPC];}
+  Double_t     GetCrvTPCErr(Int_t i)    const {return fCrvVars[i*kNVarPerTrack+kCrvTPCErr];}
+  Double_t     GetCrvGlo(Int_t i)       const {return fCrvVars[i*kNVarPerTrack+kCrvGlo];}
+  Double_t     GetCrvGloErr(Int_t i)    const {return fCrvVars[i*kNVarPerTrack+kCrvGloErr];}
+  //
+  void         Reset();
+  void         BookNTracks(Int_t n);
+  void         SetCrvTPC(Int_t i, Double_t v)       {fCrvVars[i*kNVarPerTrack+kCrvTPC] = v;}
+  void         SetCrvTPCErr(Int_t i, Double_t v)    {fCrvVars[i*kNVarPerTrack+kCrvTPCErr] = v;}
+  void         SetCrvGlo(Int_t i, Double_t v)       {fCrvVars[i*kNVarPerTrack+kCrvGlo] = v;}
+  void         SetCrvGloErr(Int_t i, Double_t v)    {fCrvVars[i*kNVarPerTrack+kCrvGloErr] = v;}
+  void         AddTrack(AliTrackPointArray* trc)    {fTracks.AddLast((TObject*)trc);}
+  void         SetVertex(const AliESDVertex* vtx)   {fVertex = *vtx;}
+  //
+ protected:
+  //
+  TObjArray    fTracks;               // TrackPoints
+  AliESDVertex fVertex;               // ESD Vertex
+  Int_t        fNVars;                // Ntracks*kNVarPerTrack
+  Double32_t*  fCrvVars;               //[fNVars];
+
+  ClassDef(AliITSSumTP,1)
+};
+
+#endif
+
index 2ee44bc..ba90f84 100644 (file)
@@ -111,7 +111,8 @@ set ( SRCS
     AliITSQASSDChecker.cxx 
     AliITSQASSDRefData.cxx 
     AliITSTrackleterSPDEff.cxx 
-    AliITSRecPointContainer.cxx 
+    AliITSRecPointContainer.cxx
+    AliITSSumTP.cxx 
     )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
index 6352ff9..3d6a39e 100644 (file)
 #pragma link C++ class AliITSAlignMilleData+;
 #pragma link C++ class AliITSTPArrayFit+;
 #pragma link C++ class AliITSRealignTracks+;
+#pragma link C++ class AliITSSumTP+;
 // Classes for QA
 #pragma link C++ class AliITSQAChecker+;
 #pragma link C++ class AliITSQADataMakerRec+;