StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MuMomShift.C
1 MuMomShift(const Int_t mode=0,
2  const Int_t nevents=10,
3  const Char_t *path="/star/data13/reco/dev/2001/10/",
4  const Char_t *file="st_physics_2304060_raw_0303.event.root",
5  const Char_t* outDir="./"){
6 
7  Char_t *tpath = "";
8 
9  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
10  // there is something stupid about the CRS system. It is not
11  // capable of passing empty string argument. So, we use "-"
12  // as a replacement for "".
13  if ( path != "-") tpath = path;
14 
15  StChain *chain=new StChain(); // Need chain for communication between makers
16  StMuDstMaker *mudst_mk=new StMuDstMaker(mode,0,tpath,file);
17 
19 
20  Int_t i_event=0;
21  while (mudst_mk->Make()==kStOk && i_event < nevents) {
22  StMuEvent *event=mudst_mk->muDst()->event();
23  Float_t mag_field=event->runInfo().magneticField();
24  if (mag_field < 2.46)
25  mom_mk->setScaleFactor(0.499/0.49);
26  else
27  mom_mk->setScaleFactor(1);
28  mom_mk->Make();
29  i_event++;
30  }
31  mom_mk->Finish();
32 }
virtual int Make()
StMuDst * muDst()
Definition: StMuDstMaker.h:425
StMuDstMaker(const char *name="MuDst")
Default constructor.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426
Definition: Stypes.h:41