CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions
TEcnaRootFile Class Reference

#include <TEcnaRootFile.h>

Inheritance diagram for TEcnaRootFile:

Public Member Functions

void CloseFile ()
 
Bool_t OpenR (const Text_t *="")
 
Bool_t OpenW (const Text_t *="")
 
Bool_t ReadElement (Int_t)
 
Bool_t ReadElement (CnaResultTyp, Int_t)
 
Int_t ReadElementNextEntryNumber (CnaResultTyp, Int_t)
 
void ReStart (const Text_t *)
 
void ReStart (const Text_t *, const TString &)
 
 TEcnaRootFile ()
 
 TEcnaRootFile (TEcnaObject *, const Text_t *, const TString &)
 
 TEcnaRootFile (TEcnaObject *, const Text_t *)
 
 TEcnaRootFile (const Text_t *)
 
 TEcnaRootFile (const Text_t *, const TString &)
 
 ~TEcnaRootFile ()
 

Public Attributes

TEcnaResultTypefCnaIndivResult
 
TBranch * fCnaResultsBranch
 
TTree * fCnaResultsTree
 
Int_t fCounterBytesCnaResults
 
Int_t fNbEntries
 
TFile * fRootFile
 
TString fRootFileName
 
TString fRootFileStatus
 

Protected Member Functions

void Init ()
 

Detailed Description


TEcnaRootFile.h Update: 30/09/2011 Authors: FX Gentit, B.Fabbro (berna.nosp@m.rd.f.nosp@m.abbro.nosp@m.@cea.nosp@m..fr) DSM/IRFU/SPP CEA-Saclay Copyright: Those valid for CEA sofware

ECNA web page: http://cms-fabbro.web.cern.ch/cms-fabbro/

cna_new/Correlated_Noise_Analysis/ECNA_cna_1.htm

Definition at line 25 of file TEcnaRootFile.h.

Constructor & Destructor Documentation

TEcnaRootFile::TEcnaRootFile ( )

Definition at line 22 of file TEcnaRootFile.cc.

22  {
23 //constructor without arguments
24 
25  // cout << "[Info Management] CLASS: TEcnaRootFile. CREATE OBJECT: this = " << this << endl;
26 
27  Init();
28 }
TEcnaRootFile::TEcnaRootFile ( TEcnaObject pObjectManager,
const Text_t *  name,
const TString &  status 
)

Definition at line 30 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, TEcnaObject::RegisterPointer(), and ntuplemaker::status.

30  {
31 //constructor
32 
33  // cout << "[Info Management] CLASS: TEcnaRootFile. CREATE OBJECT: this = " << this << endl;
34 
35  Init();
36  Long_t i_this = (Long_t)this;
37  pObjectManager->RegisterPointer("TEcnaRootFile", i_this);
38 
41 }
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:103
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
tuple status
Definition: ntuplemaker.py:245
TEcnaRootFile::TEcnaRootFile ( TEcnaObject pObjectManager,
const Text_t *  name 
)

Definition at line 43 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, and TEcnaObject::RegisterPointer().

43  {
44 //constructor
45 
46  // cout << "[Info Management] CLASS: TEcnaRootFile. CREATE OBJECT: this = " << this << endl;
47 
48  Init();
49  Long_t i_this = (Long_t)this;
50  pObjectManager->RegisterPointer("TEcnaRootFile", i_this);
51 
53  fRootFileStatus = "READ";
54 }
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:103
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
TEcnaRootFile::TEcnaRootFile ( const Text_t *  name)

Definition at line 66 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name.

66  {
67 //constructor
68 
69  // cout << "[Info Management] CLASS: TEcnaRootFile. CREATE OBJECT: this = " << this << endl;
70 
71  Init();
73  fRootFileStatus = "READ";
74 }
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
TEcnaRootFile::TEcnaRootFile ( const Text_t *  name,
const TString &  status 
)

Definition at line 56 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, and ntuplemaker::status.

56  {
57 //constructor
58 
59  // cout << "[Info Management] CLASS: TEcnaRootFile. CREATE OBJECT: this = " << this << endl;
60 
61  Init();
64 }
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
tuple status
Definition: ntuplemaker.py:245
TEcnaRootFile::~TEcnaRootFile ( )

Definition at line 76 of file TEcnaRootFile.cc.

76  {
77 //destructor
78 
79  //cout << "[Info Management] CLASS: TEcnaRootFile. DESTROY OBJECT: this = " << this << endl;
80 
81  if( fCnaIndivResult != 0 ){delete fCnaIndivResult;}
82 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45

Member Function Documentation

void TEcnaRootFile::CloseFile ( )

Definition at line 118 of file TEcnaRootFile.cc.

Referenced by TEcnaRead::CloseRootFile(), and TEcnaRun::CloseRootFile().

118  {
119 //Close the CNA root file for reading
120  if( fRootFile != 0 )
121  {
122  fRootFile->Close();
123  delete fRootFile; fRootFile = 0;
124  }
126  fCnaResultsTree = 0;
127  fCnaResultsBranch = 0;
128 }
TBranch * fCnaResultsBranch
Definition: TEcnaRootFile.h:44
Int_t fCounterBytesCnaResults
Definition: TEcnaRootFile.h:38
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
TFile * fRootFile
Definition: TEcnaRootFile.h:36
void TEcnaRootFile::Init ( void  )
protected

Definition at line 84 of file TEcnaRootFile.cc.

85 {
86 //Set default values in all variables
87 
88  TString sEmpty = "";
89  fRootFileName = sEmpty.Data();
90  fRootFileStatus = sEmpty.Data();
91 
92  fRootFile = 0;
94  fNbEntries = 0;
95  fCnaResultsTree = 0;
97  fCnaIndivResult = 0;
98 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TBranch * fCnaResultsBranch
Definition: TEcnaRootFile.h:44
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
Int_t fCounterBytesCnaResults
Definition: TEcnaRootFile.h:38
TString fRootFileName
Definition: TEcnaRootFile.h:33
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
TFile * fRootFile
Definition: TEcnaRootFile.h:36
Bool_t TEcnaRootFile::OpenR ( const Text_t *  name = "")

Definition at line 130 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, and convertSQLiteXML::ok.

Referenced by TEcnaRead::OpenRootFile(), and TEcnaRun::OpenRootFile().

130  {
131 //Open the CNA root file for reading
132  Bool_t ok;
133  TString sEmpty = "";
134  if( name != sEmpty ){fRootFileName = name;}
135 
136  if( fRootFile == 0 ){fRootFile = new TFile(fRootFileName.Data(),"READ");}
137 
138  ok = fRootFile->IsOpen();
139  if (ok) {
140  fCnaResultsTree = (TTree *)fRootFile->Get("CNAResults");
141  if (fCnaResultsTree) {
142  if( fCnaIndivResult == 0 ){fCnaIndivResult = new TEcnaResultType();}
143  fCnaResultsBranch = fCnaResultsTree->GetBranch("Results");
144  fCnaResultsBranch->SetAddress(&fCnaIndivResult);
145  fNbEntries = (Int_t)fCnaResultsTree->GetEntries();
146  }
147  else ok = kFALSE;
148  }
149  return ok;
150 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TBranch * fCnaResultsBranch
Definition: TEcnaRootFile.h:44
TString fRootFileName
Definition: TEcnaRootFile.h:33
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
TFile * fRootFile
Definition: TEcnaRootFile.h:36
Bool_t TEcnaRootFile::OpenW ( const Text_t *  name = "")

Definition at line 152 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, and convertSQLiteXML::ok.

Referenced by TEcnaRead::OpenRootFile(), and TEcnaRun::OpenRootFile().

152  {
153 //Open root file for writing
154  Bool_t ok = kTRUE;
155  TString sEmpty = "";
156  if( name != sEmpty ){fRootFileName = name;}
157 
158  if( fRootFile == 0 ){fRootFile = new TFile(fRootFileName.Data(),"RECREATE");}
159  if (fRootFile) {
160  fCnaResultsTree = new TTree("CNAResults","CNAResults");
163  Branch("Results","TEcnaResultType", &fCnaIndivResult, 64000, 0);
164  }
165  else ok = kFALSE;
166  return ok;
167 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
TBranch * fCnaResultsBranch
Definition: TEcnaRootFile.h:44
TString fRootFileName
Definition: TEcnaRootFile.h:33
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
TFile * fRootFile
Definition: TEcnaRootFile.h:36
Bool_t TEcnaRootFile::ReadElement ( Int_t  i)

Definition at line 169 of file TEcnaRootFile.cc.

References convertSQLiteXML::ok.

Referenced by TEcnaRead::ReadAverageHighFrequencyNoise(), TEcnaRead::ReadAverageLowFrequencyNoise(), TEcnaRead::ReadAverageMeanCorrelationsBetweenSamples(), TEcnaRead::ReadAveragePedestals(), TEcnaRead::ReadAverageSigmaOfCorrelationsBetweenSamples(), TEcnaRead::ReadAverageTotalNoise(), TEcnaRead::ReadCorrelationsBetweenSamples(), TEcnaRead::ReadCovariancesBetweenSamples(), TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(), TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(), TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins(), TEcnaRead::ReadHighFrequencyNoise(), TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(), TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(), TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins(), TEcnaRead::ReadLowFrequencyNoise(), TEcnaRead::ReadMeanCorrelationsBetweenSamples(), TEcnaRead::ReadNumberOfEventsForSamples(), TEcnaRead::ReadPedestals(), TEcnaRead::ReadRelevantCorrelationsBetweenSamples(), TEcnaRead::ReadSampleAdcValues(), TEcnaRead::ReadSampleAdcValuesSameFile(), TEcnaRead::ReadSampleMeans(), TEcnaRead::ReadSampleSigmas(), TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(), TEcnaRead::ReadStinNumbers(), and TEcnaRead::ReadTotalNoise().

169  {
170 //Read element i
171  Bool_t ok = kTRUE;
173  return ok;
174 }
int i
Definition: DBlmapReader.cc:9
Int_t fCounterBytesCnaResults
Definition: TEcnaRootFile.h:38
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
Bool_t TEcnaRootFile::ReadElement ( CnaResultTyp  typ,
Int_t  k 
)

Definition at line 176 of file TEcnaRootFile.cc.

References i, gen::k, and convertSQLiteXML::ok.

176  {
177 //Look for kth element of type typ
178  Bool_t ok = kFALSE;
179  Int_t i = 0;
180  do {
182  ok = ( ( fCnaIndivResult->fIthElement == k ) &&
183  ( fCnaIndivResult->fTypOfCnaResult == typ ));
184  i++;
185  } while ((i<fNbEntries) && (!ok));
186  return ok;
187 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
int i
Definition: DBlmapReader.cc:9
CnaResultTyp fTypOfCnaResult
int k[5][pyjets_maxn]
Int_t fCounterBytesCnaResults
Definition: TEcnaRootFile.h:38
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
Int_t TEcnaRootFile::ReadElementNextEntryNumber ( CnaResultTyp  typ,
Int_t  k 
)

Definition at line 189 of file TEcnaRootFile.cc.

References i, gen::k, and convertSQLiteXML::ok.

Referenced by TEcnaRead::ReadSampleAdcValuesSameFile().

189  {
190 //Look for kth element of type typ and return the next entry number
191  Bool_t ok = kFALSE;
192 
193  Int_t i = 0;
194  do {
196  ok = ( ( fCnaIndivResult->fIthElement == k ) &&
197  ( fCnaIndivResult->fTypOfCnaResult == typ ));
198  i++;
199  } while ((i<fNbEntries) && (!ok));
200 
201  if( ok == kFALSE ){i = -1;}
202  return i;
203 }
TEcnaResultType * fCnaIndivResult
Definition: TEcnaRootFile.h:45
int i
Definition: DBlmapReader.cc:9
CnaResultTyp fTypOfCnaResult
int k[5][pyjets_maxn]
Int_t fCounterBytesCnaResults
Definition: TEcnaRootFile.h:38
TTree * fCnaResultsTree
Definition: TEcnaRootFile.h:40
void TEcnaRootFile::ReStart ( const Text_t *  name)

Definition at line 100 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name.

Referenced by TEcnaRead::OpenRootFile(), and TEcnaRun::OpenRootFile().

101 {
102  // Set default values + fRootFileName + fRootFileStatus
103 
104  Init();
106  fRootFileStatus = "READ";
107 }
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
void TEcnaRootFile::ReStart ( const Text_t *  name,
const TString &  status 
)

Definition at line 109 of file TEcnaRootFile.cc.

References mergeVDriftHistosByStation::name, and ntuplemaker::status.

110 {
111  // Set default values + fRootFileName + fRootFileStatus
112 
113  Init();
116 }
TString fRootFileStatus
Definition: TEcnaRootFile.h:34
TString fRootFileName
Definition: TEcnaRootFile.h:33
tuple status
Definition: ntuplemaker.py:245

Member Data Documentation

TEcnaResultType* TEcnaRootFile::fCnaIndivResult

Definition at line 45 of file TEcnaRootFile.h.

Referenced by TEcnaRead::ReadAverageHighFrequencyNoise(), TEcnaRead::ReadAverageLowFrequencyNoise(), TEcnaRead::ReadAverageMeanCorrelationsBetweenSamples(), TEcnaRead::ReadAveragePedestals(), TEcnaRead::ReadAverageSigmaOfCorrelationsBetweenSamples(), TEcnaRead::ReadAverageTotalNoise(), TEcnaRead::ReadCorrelationsBetweenSamples(), TEcnaRead::ReadCovariancesBetweenSamples(), TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(), TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(), TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins(), TEcnaRead::ReadHighFrequencyNoise(), TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(), TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(), TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins(), TEcnaRead::ReadLowFrequencyNoise(), TEcnaRead::ReadMeanCorrelationsBetweenSamples(), TEcnaRead::ReadNumberOfEventsForSamples(), TEcnaRead::ReadPedestals(), TEcnaRead::ReadRelevantCorrelationsBetweenSamples(), TEcnaRead::ReadSampleAdcValues(), TEcnaRead::ReadSampleAdcValuesSameFile(), TEcnaRead::ReadSampleMeans(), TEcnaRead::ReadSampleSigmas(), TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(), TEcnaRead::ReadStinNumbers(), TEcnaRead::ReadTotalNoise(), TEcnaRun::TRootAdcEvt(), TEcnaRun::TRootAvEvCorss(), TEcnaRun::TRootAvHfn(), TEcnaRun::TRootAvLfn(), TEcnaRun::TRootAvPed(), TEcnaRun::TRootAvSigCorss(), TEcnaRun::TRootAvTno(), TEcnaRun::TRootCorCss(), TEcnaRun::TRootCovCss(), TEcnaRun::TRootHFccMoStins(), TEcnaRun::TRootHfCor(), TEcnaRun::TRootHfCov(), TEcnaRun::TRootHfn(), TEcnaRun::TRootLFccMoStins(), TEcnaRun::TRootLfCor(), TEcnaRun::TRootLfCov(), TEcnaRun::TRootLfn(), TEcnaRun::TRootMeanCorss(), TEcnaRun::TRootMSp(), TEcnaRun::TRootNbOfEvts(), TEcnaRun::TRootPed(), TEcnaRun::TRootSigCorss(), TEcnaRun::TRootSSp(), TEcnaRun::TRootStinNumbers(), TEcnaRun::TRootTno(), and TEcnaRun::WriteRootFile().

TBranch* TEcnaRootFile::fCnaResultsBranch

Definition at line 44 of file TEcnaRootFile.h.

TTree* TEcnaRootFile::fCnaResultsTree

Definition at line 40 of file TEcnaRootFile.h.

Referenced by TEcnaRun::WriteRootFile().

Int_t TEcnaRootFile::fCounterBytesCnaResults

Definition at line 38 of file TEcnaRootFile.h.

Int_t TEcnaRootFile::fNbEntries

Definition at line 39 of file TEcnaRootFile.h.

TFile* TEcnaRootFile::fRootFile

Definition at line 36 of file TEcnaRootFile.h.

Referenced by TEcnaRead::ReadRootFileHeader(), and TEcnaRun::WriteRootFile().

TString TEcnaRootFile::fRootFileName

Definition at line 33 of file TEcnaRootFile.h.

TString TEcnaRootFile::fRootFileStatus

Definition at line 34 of file TEcnaRootFile.h.

Referenced by TEcnaRead::OpenRootFile(), and TEcnaRun::OpenRootFile().