StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StStrangeMuDstMaker.cxx
1 // //
3 // StStrangeMuDstMaker strangeness micro DST maker //
4 // //
6 #include "StStrangeMuDstMaker.h"
7 #include "TFile.h"
8 #include "TChain.h"
9 #include "THack.h"
10 #include "StTree.h"
11 #include "StEvent/StEvent.h"
12 #include "StEvent.h"
13 #include "StStrangeEvMuDst.hh"
14 #include "StStrangeCuts.hh"
15 #include "StMcEventTypes.hh"
16 #include "StParticleDefinition.hh"
17 #include "StMessMgr.h"
18 #include "StuJitterBug.hh"
19 
20 // Set maximum file size to 1.9 GB (Root has a 2GB limit)
21 #define MAXFILESIZE 1900000000
22 
23 #define EachDoT(proc) \
24  for (Int_t i=1; i<strDstT; i++) { \
25  if (doT[i]) proc; }
26 
27 #define EachController(proc) EachDoT( if( cont[i]) cont[i]->proc );
28 
29 // Defaults file and tree names;
30 static const char* defFileName = "evMuDst.root";
31 static const char* defName = "StrangeMuDst";
32 static const char* altName = "MuDst";
33 static const char* defTitle = "Strangeness Micro-DST";
34 static const char* trNames[3] = {defName,altName,0};
35 
36 Int_t thisRun,thisEvent,lastRun,lastEvent,readEventNumber;
37 TFile* lastFile;
38 
39 ClassImp(StStrangeMuDstMaker)
40 //_____________________________________________________________________________
41 StStrangeMuDstMaker::StStrangeMuDstMaker(const char *name) : StMaker(name) {
42 
43  muDst = 0;
44  tree = 0;
45  chain = 0;
46  evClonesArray = 0;
47  evMcArray = 0;
48  cutsArray = 0;
49  dstMaker = 0;
50  cuts = new StStrangeCuts();
51  SetNumber(-2);
52  outFileNum = 1;
53  doT0JitterAbort = kFALSE;
54 
55  //printf("DEBUG :: >>>>>>>> %d \n",strDstT);
56 
57  for (Int_t i=0; i<strDstT; i++) {
58  doT[i] = kFALSE;
59  cont[i] = 0;
60  bsize[i] = 0;
61  }
62 
63  strcpy(file,defFileName);
64  fileBlind = kFALSE;
65 
66  doMc = kFALSE;
67  SetMode(StrangeNoFile);
68  abortEvent = kFALSE;
69 
70  bsize[evT] = 64000;
71 
72  thisRun = -1;
73  thisEvent = -1;
74  lastRun = -1;
75  lastEvent = -1;
76  lastFile = 0;
77 }
78 //_____________________________________________________________________________
79 StStrangeMuDstMaker::~StStrangeMuDstMaker() {
80 
81  if (!dstMaker) { // Don't delete other maker's array!
82  delete evClonesArray; evClonesArray = 0;
83  if (evMcArray) { delete evMcArray; evMcArray = 0; }
84  }
85  delete cutsArray; cutsArray = 0;
86  delete cuts; cuts = 0;
87  for (int i=0;i<strDstT;i++) {delete cont[i]; cont[i]=0;}
88 
89 }
90 //_____________________________________________________________________________
91 Int_t StStrangeMuDstMaker::Init() {
92 
93  if ( 1 == IAttr( "DoV0" ) ) DoV0();
94  if ( 1 == IAttr( "DoXi" ) ) DoXi();
95  if ( 1 == IAttr( "DoKink" ) ) DoKink();
96  if ( 1 == IAttr( "SetNoKeep" ) ) SetNoKeep();
97 
98  abortEvent = kFALSE;
99  firstEvent = kTRUE;
100  if (Debug()) gMessMgr->Debug() << "In StStrangeMuDstMaker::Init() ... "
101  << GetName() << endm;
102  if ((GetMode() == StrangeWrite) && (OpenFile() == kStErr)) return kStEOF;
103  if (!dstMaker) {
104  evClonesArray = new TClonesArray("StStrangeEvMuDst",1);
105  if (doMc) evMcArray = new TClonesArray("StStrangeEvMuDst",1);
106  }
107  cutsArray = new TClonesArray("TCut",0);
108  StStrangeControllerBase::currentMaker = this;
109  {
110  EachDoT(cont[i] = StStrangeControllerBase::Instantiate(i));
111  //printf("DEBUG :: %d \n",strDstT);
112  //for(Int_t i=1; i < strDstT; i++) printf("DEBUG :: %d\n",cont[i]);
113  }
114 
115  v0 = cont[v0T];
116  xi = cont[xiT];
117  kink = cont[kinkT];
118 
119  if (GetMode() == StrangeNoKeep) {
120  {EachDoT( cont[i]->SetBufferSize(32000) );}
121  } else {
122  {EachDoT( if (bsize[i]) cont[i]->SetBufferSize(bsize[i]) );}
123  }
124 
125  if (GetMode() == StrangeRead) { // READING the Micro Dst
126  InitReadDst();
127  if (dstMaker) {
128  gMessMgr->Error() << "StStrangeMuDstMaker: cannot read a dst and create "
129  << "a dst with one maker.\n"
130  << " Will read only." << endm;
131  dstMaker = 0;
132  }
133  } else { // CREATING the Micro Dst
134  InitCreateDst();
135  }
136 
137  return StMaker::Init();
138 }
139 //_____________________________________________________________________________
140 void StStrangeMuDstMaker::InitReadDst() {
141 
142  if (!((tree) && (muDst))) {
143  gMessMgr->Error(
144  "StStrangeMuDstMaker: no appropriate tree in input file(s)!");
145  return;
146  }
147 
148  // 5/20/02 - GVB
149  // Correct for a problem with setting branch file names in old MuDSTs.
150  // Setting of branch file names has now been removed (never worked anyhow).
151  if (strcmp(tree->GetBranch("Event")->GetFileName(),"")) {
152  TObjArray* listOfBranches = tree->GetListOfBranches();
153  for (int i=0; i<listOfBranches->GetEntriesFast(); i++)
154  ((TBranch*) listOfBranches->At(i))->SetFile(muDst);
155  }
156 
157  tree->SetBranchStatus("*",0);
158  tree->SetBranchStatus("Event.*",1);
159  tree->SetBranchAddress("Event",&evClonesArray);
160  if (doMc) {
161  tree->SetBranchStatus("McEvent.*",1);
162  tree->SetBranchAddress("McEvent",&evMcArray);
163  }
164  EachController(InitReadDst());
165 
166  if (tree->GetBranch("StrangeCuts")) {
167  tree->SetBranchStatus("StrangeCuts.*",1);
168  tree->SetBranchAddress("StrangeCuts",&cutsArray);
169  } else {
170  TOrdCollection* ordCuts = (TOrdCollection*) muDst->Get("StrangeCuts");
171  if (ordCuts) {
172  cuts->Reset(ordCuts);
173  } else {
174  gMessMgr->Warning("StStrangeMuDstMaker: no StrangeCuts");
175  cuts->UnknownCuts();
176  }
177  }
178 
179  if( Debug() ) {
180  TObjArray *listOfBranches = tree->GetListOfBranches();
181  for( Int_t i=0; i<tree->GetNbranches(); i++) {
182  const char* n = ((TBranch*) listOfBranches->At(i))->GetName();
183  gMessMgr->Debug() << "Branch " << n << " Status = " << tree->GetBranchStatus(n) << endm;
184  }
185  }
186 }
187 //_____________________________________________________________________________
188 void StStrangeMuDstMaker::InitCreateDst() {
189 
190  tree = new TTree(defName,defTitle);
191  tree->SetDirectory(muDst);
192  EachController(InitCreateDst());
193 
194  Int_t split = 99;
195  TBranch* branch = tree->Branch("StrangeCuts",&cutsArray,bsize[evT],split);
196  if (!dstMaker) {
197  branch = tree->Branch("Event",&evClonesArray,bsize[evT],split);
198  if (doMc) {
199  branch = tree->Branch("McEvent",&evMcArray,bsize[evT],split);
200  }
201  }
202 
203  if (firstEvent) cuts->Init();
204 }
205 //_____________________________________________________________________________
206 void StStrangeMuDstMaker::InitCreateSubDst() {
207 
208  Int_t split=2;
209  evClonesArray = dstMaker->GetEvClonesArray();
210  TBranch* branch = tree->Branch("Event",&evClonesArray,bsize[evT],split);
211  if (doMc) {
212  evMcArray = dstMaker->GetEvMcArray();
213  branch = tree->Branch("McEvent",&evMcArray,bsize[evT],split);
214  }
215  EachController(InitCreateSubDst());
216 }
217 //_____________________________________________________________________________
219 
220  if (Debug()) gMessMgr->Debug() << "In StStrangeMuDstMaker::Make() ... "
221  << GetName() << endm;
222 
223  if (GetMode() == StrangeRead) { // READING the Micro Dst
224  return MakeReadDst();
225  } else if (!dstMaker) { // CREATING a new Micro Dst
226  return MakeCreateDst();
227 
228  // Else creating a sub-Micro Dst, done in the Clear() stage.
229  // However, since the old Micro Dst's Init() is called AFTER the new
230  // one's, special initialization for the subDST must be done on the
231  // first time through Make().
232  } else if (!evClonesArray) {
233  InitCreateSubDst();
234  }
235  return kStOK;
236 }
237 //_____________________________________________________________________________
238 Int_t StStrangeMuDstMaker::MakeReadDst() {
239 
240  if (!((tree) && (muDst))) return kStEOF;
241  Int_t makerEventNumber = GetNumber();
242  if (makerEventNumber == -2) { // If event numbers aren't supplied,
243  readEventNumber = 0; // start at 0 and increment ourselves.
244  SetNumber(-1); // Use m_Number = -1 to indicate this.
245  } else if (makerEventNumber == -1) {
246  readEventNumber++;
247  } else {
248  readEventNumber = makerEventNumber;
249  }
250 
251 
252  if (tree->GetEvent(readEventNumber) <= 0) return kStEOF; // Read the event
253 
254  TFile* thisFile = chain->GetFile();
255  if (thisFile != lastFile) {
256  gMessMgr->Info() << "StStrangeMuDstMaker: Now reading from event file:\n "
257  << thisFile->GetName() << endm;
258  lastFile = thisFile;
259  }
260 
261  // Overcome a bug where event wasn't meant to be recorded into a muDst,
262  // but was anyhow (with the previous event's info, or none at all)
263  Bool_t badEvent = kTRUE;
264  if (GetEvent()) {
265  thisRun = GetEvent()->run();
266  thisEvent = GetEvent()->event();
267  badEvent = (thisRun == lastRun) && (thisEvent == lastEvent);
268  }
269  if (badEvent) {
270  if (makerEventNumber < 0 ) {
271  // User is calling Make() (not asking for a specific event).
272  // Automatically skip to next event.
273  return MakeReadDst();
274  } else {
275  // User is calling Make(i) (asking for a specific event i).
276  // Return a "cleared" event.
277  gMessMgr->Warning() <<
278  "StStrangeMuDstMaker: event on file has bad event info\n" <<
279  " and should be skipped!" << endm;
280  GetEvent()->Clear();
281  EachController(Clear());
282  return kStOK;
283  //return kStSkip;
284  }
285  } else {
286  lastRun = thisRun;
287  lastEvent = thisEvent;
288  }
289 
290  if (cutsArray->GetEntriesFast()) cuts->Reset(cutsArray);
291 
292  EachController(MakeReadDst());
293 
294  return kStOK;
295 }
296 //_____________________________________________________________________________
297 Int_t StStrangeMuDstMaker::MakeCreateDst() {
298 
299  if (abortEvent) return kStOK;
300 
301  // Get the cut parameters and fill StrangeCuts on the first event
302  if (firstEvent) {
303  Int_t iSize = cuts->GetSize();
304  cuts->Fill(strTypeNames[v0T], GetDataSet("ev0par2"));
305  cuts->Fill(strTypeNames[xiT], GetDataSet("exipar"));
306  cuts->Fill(strTypeNames[kinkT], GetDataSet("tkf_tkfpar"));
307  Int_t fSize = cuts->GetSize();
308  if (!(fSize-iSize)) {
309  gMessMgr->Warning("StStrangeMuDstMaker: no cut parameters found.");
310  cuts->UnknownCuts();
311  }
312  firstEvent = kFALSE;
313  }
314 
315  // Get event
316  StEvent* event = (StEvent*) GetInputDS("StEvent");
317  if (!event) return kStOK;
318 
319  new((*evClonesArray)[0]) StStrangeEvMuDst(*event);
320  cuts->UpdateArray(cutsArray);
321 
322  if (doT0JitterAbort && t0JitterAbort(event)) {
323  gMessMgr->Warning("StStrangeMuDstMaker: T0 jitter; skipping event.");
324  return kStWarn;
325  }
326 
327  EachController(MakeCreateDst(*event));
328  if (doMc) MakeCreateMcDst();
329 
330  CheckFile();
331  tree->Fill();
332 
333  return kStOK;
334 }
335 //_____________________________________________________________________________
336 Int_t StStrangeMuDstMaker::MakeCreateMcDst() {
337 
338  gMessMgr->Info("StStrangeMuDstMaker::MakeCreateMcDst(): running...");
339 
340  StMcEvent* mcEvent = (StMcEvent*) GetDataSet("StMcEvent");
341  if (!mcEvent) {
342  gMessMgr->Error() << "StStrangeMuDstMaker: no StMcEvent! \n"
343  << " mc branch and assoc branch will not be filled. " << endm;
344  return 0;
345  }
346  new((*evMcArray)[0]) StStrangeEvMuDst(*mcEvent);
347  if (!GetMaker("StAssociationMaker")) {
348  gMessMgr->Warning() << "StStrangeMuDstMaker: no associated info! \n"
349  << " assoc branch will not be filled. " << endm;
350  }
351 
352  //Loop over all MC vertices
353  StSPtrVecMcVertex& mcVertices = mcEvent->vertices();
354  for (StMcVertexIterator mcVertexIt = mcVertices.begin();
355  mcVertexIt != mcVertices.end(); mcVertexIt++) {
356  const StMcTrack* parent = (*mcVertexIt)->parent();
357  if (parent) switch (parent->geantId()) {
358 
359  // Xi vertex candidates
360  case (23) : // Xi-
361  case (31) : // AntiXi+
362  case (24) : // Omega-
363  case (32) : // AntiOmega+
364  if (doT[xiT]) cont[xiT]->MakeCreateMcDst(*mcVertexIt);
365  break;
366 
367  // V0 vertex candidates
368  case (10) : // Kaon0Long
369  case (16) : // Kaon0Short
370  case (18) : // Lambda
371  case (26) : // AntiLambda
372  // Do all V0's here only if not doing Xi's
373  if (doT[v0T] && !(doT[xiT])) cont[v0T]->MakeCreateMcDst(*mcVertexIt);
374  break;
375 
376  // Kink vertex candidates
377  case ( 5) : // Muon+
378  case ( 6) : // Muon-
379  case ( 8) : // Pion+
380  case ( 9) : // Pion-
381  case (11) : // Kaon+
382  case (12) : // Kaon-
383  // Keep all kinks
384  if (doT[kinkT]) cont[kinkT]->MakeCreateMcDst(*mcVertexIt);
385  break;
386 
387  default : {}
388  }
389  }//end of loop over MC vertices
390 
391  // If doing Xi's, all Xi V0 daughters are done concurrently with their Xi.
392  // Do all non-Xi V0's at the end...
393  if (doT[xiT] && doT[v0T]) {
394  for (StMcVertexIterator mcVertexIt = mcVertices.begin();
395  mcVertexIt != mcVertices.end(); mcVertexIt++) {
396  Bool_t notFromXi = kTRUE;
397  const StMcTrack* parent = (*mcVertexIt)->parent();
398  if (parent) switch (parent->geantId()) {
399  case (18) : // Lambda
400  case (26) : // AntiLambda
401  { // Check for cascade parentage
402  const StMcTrack* parent2 = parent->parent();
403  if (parent2) switch (parent2->geantId()) {
404  case (23) : // Xi-
405  case (31) : // AntiXi+
406  case (24) : // Omega-
407  case (32) : // AntiOmega+
408  notFromXi = kFALSE;
409  default : {}
410  }
411  }
412  case (10) : // Kaon0Long
413  case (16) : // Kaon0Short
414  if (notFromXi) cont[v0T]->MakeCreateMcDst(*mcVertexIt);
415  default : {}
416  }
417  }
418  }//end of loop over MC vertices
419  EachController(PrintNumMc());
420 
421  return kStOK;
422 }
423 //_____________________________________________________________________________
424 Int_t StStrangeMuDstMaker::MakeCreateSubDst() {
425 
426  if (abortEvent) return kStOK;
427 
428  EachController(MakeCreateSubDst());
429  CheckFile();
430  cuts->Reset(dstMaker->Cuts());
431  cuts->UpdateArray(cutsArray);
432  tree->Fill();
433 
434  return kStOK;
435 }
436 //_____________________________________________________________________________
437 void StStrangeMuDstMaker::Clear(Option_t *option) {
438 
439  if (Debug()) gMessMgr->Debug() << "In StStrangeMuDstMaker::Clear() ... "
440  << GetName() << endm;
441 
442  for (Int_t i=0; i<subMakers.GetEntries(); i++) {
443  StStrangeMuDstMaker* subMaker = (StStrangeMuDstMaker*) (subMakers[i]);
444  subMaker->ClearForReal(option);
445  }
446  if (!dstMaker) {
447  ClearForReal(option);
448  }
449 }
450 //_____________________________________________________________________________
451 void StStrangeMuDstMaker::ClearForReal(Option_t *option) {
452 
453  if (Debug()) gMessMgr->Debug() <<
454  "In StStrangeMuDstMaker::ClearForReal() ... " << GetName() << endm;
455 
456  if (tree) {
457  if (dstMaker) { // Making a subDST
458  MakeCreateSubDst();
459  } else {
460  if (evClonesArray) THack::ClearClonesArray(evClonesArray); // Not if making a subDST
461  if (evMcArray) THack::ClearClonesArray(evMcArray); // Not if making a subDST
462  }
463  THack::ClearClonesArray(cutsArray);
464 
465  EachController(Clear());
466  if (GetMode() == StrangeNoKeep) tree->Reset();
467  }
468 
469  abortEvent = kFALSE;
470  StMaker::Clear(option);
471 }
472 //_____________________________________________________________________________
474 
475  if (Debug()) gMessMgr->Debug() << "In StStrangeMuDstMaker::Finish() ... "
476  << GetName() << endm;
477  if (GetMode() == StrangeWrite) CloseFile();
478  //printf("DEBUG :: >>>>>>>> %d \n",strDstT);
479  EachController(Finish());
480 
481  return kStOK;
482 }
483 //_____________________________________________________________________________
484 void StStrangeMuDstMaker::SetWrite(const char* eFile) {
485  SetMode(StrangeWrite);
486  SetFile(eFile);
487 }
488 //_____________________________________________________________________________
489 void StStrangeMuDstMaker::SetRead(const char* eFile, const char* treeName) {
490  SetMode(StrangeRead);
491  if (!eFile) eFile = defFileName;
492 
493  // If we already have a muDst file, we're all set on TTree names
494  if (!muDst) {
495  if (!treeName) treeName = altName;
496  else fileBlind = kTRUE; // don't read file headers beforehand
497 
498  if (!tree) tree = (TTree*) (chain = new TChain(treeName,defTitle));
499  else SetTreeName(treeName);
500  }
501 
502  // Try to add the file
503  Long_t nEntries = chain->GetEntriesFast();
504  if (fileBlind) chain->Add(eFile);
505  else chain->Add(eFile,0);
506 
507  cuts->ForceUpdateArray();
508 
509  // If we already have an appropriate TTree and file specified, we're done
510  if (muDst) return;
511 
512  // If a TTree name was specified (so we continue blindly: faster, but
513  // there are no checks that a file is problematic until we reach it)...
514  if (fileBlind) { muDst = chain->GetFile(); return; }
515 
516  // Have not yet found an appropriate TTree - attempting to find one
517  // GetEntries() will increase if the tree is found
518  Long_t nEnt = chain->GetEntries();
519 
520  if (nEnt == TChain::kBigNumber) {
521  gMessMgr->Error("StStrangeMuDstMaker::SetRead(): bad file! Giving up.");
522  return;
523  }
524 
525  Int_t trial=0;
526  while (nEnt==nEntries) {
527  if (trNames[trial]==0) { SetTreeName(treeName); return; } // No tree found
528  // Trying other names until we succeed...
529  if (strcmp(treeName,trNames[trial])) {
530  SetTreeName(trNames[trial]);
531  chain->Add(eFile,0);
532  nEnt = chain->GetEntries();
533  }
534  trial++;
535  }
536 
537  muDst = chain->GetFile();
538 }
539 //_____________________________________________________________________________
540 void StStrangeMuDstMaker::SetRead(StFile* eFiles, const char* treeName) {
541  SetMode(StrangeRead);
542  while (!(eFiles->GetNextBundle()))
543  SetRead(eFiles->GetFileName(0),treeName);
544 }
545 //_____________________________________________________________________________
546 void StStrangeMuDstMaker::SetNoKeep() {
547  SetMode(StrangeNoKeep);
548 }
549 //_____________________________________________________________________________
550 void StStrangeMuDstMaker::SetFile(const char* eFile) {
551  if (eFile) strcpy(file,eFile);
552 }
553 //_____________________________________________________________________________
554 void StStrangeMuDstMaker::SetTreeName(const char* treeName) {
555  if ((treeName) && (strcmp(treeName,tree->GetName()))) {
556  tree->SetName(treeName);
557  TObjArray* chainElems = chain->GetListOfFiles();
558  for (Int_t i=0; i<chainElems->GetEntriesFast(); i++)
559  ((TNamed*) (chainElems->At(i)))->SetName(treeName);
560  }
561 }
562 //_____________________________________________________________________________
563 Int_t StStrangeMuDstMaker::OpenFile() {
564  if( ! (muDst = new TFile(file,"RECREATE")) ) {
565  gMessMgr->Error() << "StStrangeMuDstMaker: Error opening event file:\n "
566  << file << endm;
567  return kStErr;
568  }
569 
570  gMessMgr->Info() << "StStrangeMuDstMaker: Opened file for writing:\n"
571  << file << endm;
572  cuts->ForceUpdateArray();
573  return kStOk;
574 }
575 //_____________________________________________________________________________
576 Int_t StStrangeMuDstMaker::CloseFile() {
577  if (muDst) {
578  muDst->Write();
579  muDst->cd();
580  muDst->Close();
581  tree = 0;
582  }
583  return kStOk;
584 }
585 //_____________________________________________________________________________
586 void StStrangeMuDstMaker::CheckFile() {
587  if (muDst) {
588  if (muDst->GetBytesWritten() > MAXFILESIZE) {
589  gMessMgr->Warning() << "StStrangeMuDstMaker: File size limit "
590  << MAXFILESIZE << " exceeded!\n"
591  << " Closing file " << file << endm;
592  CloseFile();
593  char buf_[10];
594  sprintf(buf_,"_%d",(++outFileNum));
595  TString fixer = file;
596  if (outFileNum>2) {
597  TString suffix = strrchr(file,'.');
598  size_t last_ = fixer.Last('_');
599  size_t len_ = fixer.Length() - last_;
600  fixer.Remove(last_,len_).Append(buf_).Append(suffix);
601  } else {
602  size_t lastdot = fixer.Last('.');
603  fixer.Insert(lastdot,buf_);
604  }
605  strcpy(file,fixer.Data());
606  OpenFile();
607  InitCreateDst();
608  if (dstMaker) InitCreateSubDst();
609  }
610  }
611 }
612 //_____________________________________________________________________________
614  EachController(Select(-1));
615 }
616 //_____________________________________________________________________________
618  EachController(Unselect(-1));
619 }
620 //_____________________________________________________________________________
621 void StStrangeMuDstMaker::SubDst(StStrangeMuDstMaker* maker) {
622  dstMaker = maker;
623  if (!(maker->subMakers.FindObject((TObject*) this)))
624  maker->subMakers.Add(this);
625 }
626 //_____________________________________________________________________________
627 void StStrangeMuDstMaker::SetCorrectionFile(char* fname) {
628  StStrangeEvMuDst::SetCorrectionFile(fname);
629 }
630 //_____________________________________________________________________________
631 void StStrangeMuDstMaker::SetFractionFile(char* fname) {
633 }
634 //_____________________________________________________________________________
635 char* StStrangeMuDstMaker::GetFile() {
636  if (chain) {
637  TFile* fptr = chain->GetFile();
638  if (fptr) return const_cast<char*> (fptr->GetName());
639  }
640  return file;
641 }
642 
643 //_____________________________________________________________________________
644 // $Id: StStrangeMuDstMaker.cxx,v 3.35 2009/09/02 19:39:44 genevb Exp $
645 // $Log: StStrangeMuDstMaker.cxx,v $
646 // Revision 3.35 2009/09/02 19:39:44 genevb
647 // Fixes to pointer and string conversions (RT ticket 1612), prep for 64-bit
648 //
649 // Revision 3.34 2005/09/27 20:32:22 genevb
650 // New method for StMcEvent access
651 //
652 // Revision 3.33 2004/11/02 17:54:07 genevb
653 // Leave corrupt file protection to ROOT / Remove my protection
654 //
655 // Revision 3.32 2004/10/13 16:41:19 genevb
656 // Use kStEOF returns to terminate chain
657 //
658 // Revision 3.31 2004/08/19 19:55:52 perev
659 // Replace Delete to THack:ClearClone
660 //
661 // Revision 3.30 2004/07/12 21:45:34 genevb
662 // Handle missing Event branch info condition
663 //
664 // Revision 3.29 2003/12/07 00:49:40 genevb
665 // Include events with no primary vertex
666 //
667 // Revision 3.28 2003/11/13 02:57:08 perev
668 // LeakOff TClonesArray::Clear() ==> Delete()
669 //
670 // Revision 3.27 2003/11/10 04:06:47 perev
671 // delete controllers added in dtr
672 //
673 // Revision 3.26 2003/07/09 21:58:30 genevb
674 // Use Get/SetMode() from StMaker
675 //
676 // Revision 3.25 2003/05/14 00:12:41 jones
677 // Stops if StFile input file doesn't exist. Added some debugging info on branch status
678 //
679 // Revision 3.24 2003/03/20 00:26:05 jeromel
680 // Logic correction ; can't call a method if no instance
681 //
682 // Revision 3.23 2003/02/10 17:55:55 genevb
683 // Output currently read file
684 //
685 // Revision 3.22 2003/02/10 16:02:24 genevb
686 // Now read files using TChains; no splitting of MuDst file
687 //
688 // Revision 3.21 2003/01/16 20:38:36 genevb
689 // Reduce buffer size for NoKeep option
690 //
691 // Revision 3.20 2002/06/21 02:43:59 genevb
692 // handle events without primary vertex better
693 //
694 // Revision 3.19 2002/06/19 15:08:40 genevb
695 // Allow all MC kinks to be kept
696 //
697 // Revision 3.18 2002/05/29 19:08:16 genevb
698 // Better handling of improperly closed files
699 //
700 // Revision 3.17 2002/05/20 21:37:12 genevb
701 // Fixed problem with file names for branches
702 //
703 // Revision 3.16 2002/05/10 20:59:31 genevb
704 // Fixed bug with branch status and changed cuts split level
705 //
706 // Revision 3.15 2002/04/30 16:02:48 genevb
707 // Common muDst, improved MC code, better kinks, StrangeCuts now a branch
708 //
709 // Revision 3.14 2001/11/05 23:41:06 genevb
710 // Add more dEdx, B field info, careful of changes to TTree unrolling
711 //
712 // Revision 3.13 2001/09/14 21:39:02 genevb
713 // Adjustments to not depend on order in which maker Clear() is called
714 //
715 // Revision 3.12 2001/08/23 13:20:55 genevb
716 // Many bug workarounds...
717 //
718 // Revision 3.11 2001/05/04 20:15:14 genevb
719 // Common interfaces and reorganization of components, add MC event info
720 //
721 // Revision 3.10 2001/04/25 18:20:53 perev
722 // HPcorrs
723 //
724 // Revision 3.9 2001/01/30 04:06:54 genevb
725 // Better handling of file switches
726 //
727 // Revision 3.8 2001/01/04 01:03:23 genevb
728 // Add CheckFile() for creating sub-dsts
729 //
730 // Revision 3.7 2000/12/18 21:35:18 genevb
731 // Introduced variable buffer-sizing
732 //
733 // Revision 3.6 2000/10/27 21:55:31 genevb
734 // Allow use of event.root files
735 //
736 // Revision 3.5 2000/09/28 20:16:05 jones
737 // Added doT0JitterAbort() optio; added fix to CheckFile in case of no file
738 //
739 // Revision 3.4 2000/09/07 02:22:09 genevb
740 // Added AbortEvent() functionality
741 //
742 // Revision 3.3 2000/08/10 01:14:17 genevb
743 // Upped basket size of event branch; Set old file format
744 //
745 // Revision 3.2 2000/07/17 20:28:40 genevb
746 // File size limitation workaround, some under the hood improvements
747 //
748 // Revision 3.1 2000/07/14 21:28:34 genevb
749 // Added V0Mc index for XiMc, fixed bug with entries for XiMc, cleaned up controllers
750 //
751 // Revision 3.0 2000/07/14 12:56:49 genevb
752 // Revision 3 has event multiplicities and dedx information for vertex tracks
753 //
754 // Revision 2.1 2000/06/09 22:17:10 genevb
755 // Allow MC data to be copied between DSTs, other small improvements
756 //
757 // Revision 2.0 2000/06/02 22:11:54 genevb
758 // New version of Strangeness micro DST package
759 //
760 // Revision 1.8 2000/04/27 14:17:34 genevb
761 // Safer deletes
762 //
763 // Revision 1.7 2000/04/27 14:13:04 genevb
764 // Added old tree deletion
765 //
766 // Revision 1.6 2000/04/18 02:30:04 genevb
767 // Added multi-file capabilities
768 //
769 // Revision 1.5 2000/04/07 18:18:30 genevb
770 // Additional crash protection
771 //
772 // Revision 1.4 2000/04/06 14:51:11 genevb
773 // Fixed bug with storing event info when making subDST
774 //
775 // Revision 1.3 2000/04/05 20:23:53 genevb
776 // Introduce creating sub-Micro DSTs, dynamic expansion of clones arrays as needed, SetNoKeep() function
777 //
778 // Revision 1.2 2000/03/29 20:52:13 genevb
779 // Added StKinkMuDst, replaced arrays
780 //
781 // Revision 1.1 2000/03/29 03:10:07 genevb
782 // Introduction of Strangeness Micro DST package
783 //
static void SetFractionFile(char *)
Set files to use.
Definition: StTree.h:125
virtual Int_t GetNumber() const
STAR methods.
Definition: StMaker.cxx:256
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
virtual void Clear(Option_t *option="")
User defined functions.
void UnselectEvent()
Unselect whole event for sub DST.
Event.
Definition: Stypes.h:43
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
Definition: Stypes.h:42
Definition: Stypes.h:40
Int_t run() const
Run number.
Definition: Stypes.h:44
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169
void SelectEvent()
Select whole event for sub DST.
Int_t event() const
Event number.
Definition: Stypes.h:41