Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_TestBeam.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_TestBeam.C
1 #include <string>
2 
3 using namespace std;
4 
5 void Fun4All_TestBeam(int nEvents = 10,
6  const char *input_file = "/sphenix/data/data03//phnxreco/sphenix/t1044/fnal/beam/beam_00000499-0000.prdf",
7  const char *output_file = "beam_00000499.root"
8  )
9 {
10  gSystem->Load("libfun4all");
11  gSystem->Load("libPrototype4.so");
12  gSystem->Load("libMvtxPrototype1.so");
13 
15  //se->Verbosity(0);
17 
18  char ifile[strlen(input_file)+1]; // + 1 for the \0 which marks the end of string
19  strcpy(ifile,input_file);
20  strtok(ifile,"_");
21  int runnumber = atoi(strtok(0,"-"));
22  int segnumber = atoi(strtok(strtok(0,"-"),"."));
23  cout << "runnumber: " << runnumber << " segment " << segnumber << endl;
24 
26  rc->set_IntFlag("RUNNUMBER",runnumber);
27 
28  MvtxRunInfoUnpackPRDF *unpack_run = new MvtxRunInfoUnpackPRDF();
29  unpack_run->Verbosity(0);
30  se->registerSubsystem(unpack_run);
31 
32  MvtxUnpackPRDF *unpack = new MvtxUnpackPRDF();
33  if ( runnumber>=89 && runnumber<=97 ){ //brick runs
34  unpack->SetCutOccupPerChip(1e-3);
35  }else{
36  unpack->SetCutOccupPerChip(1e-4);
37  }
38  unpack->Verbosity(0);
39  se->registerSubsystem(unpack);
40 
41  MvtxApplyHotDead *hotdead = new MvtxApplyHotDead("MvtxApplyHotDead",Form("hotmap/hotmap_testbeam_%08d.txt",runnumber));
42  hotdead->Verbosity(0);
43  hotdead->PrintHotDeadMap();
44  se->registerSubsystem(hotdead);
45 
46  MvtxClusterizer *clus = new MvtxClusterizer();
47  clus->Verbosity(0);
48  se->registerSubsystem(clus);
49 
50  MvtxAlign *align = new MvtxAlign("MvtxAlign");
51  align->SetAlignmentParFileDir("beamcenter/");
52  align->PrintAlignmentPars();
53  align->Verbosity(0);
54  se->registerSubsystem(align);
55 
56  MvtxQAHisto *qa = new MvtxQAHisto();
57  qa->set_filename(Form("MvtxQAHisto-%08d-%04d.root",runnumber,segnumber+200));
58  se->registerSubsystem(qa);
59 
61  in->fileopen(input_file);
62  se->registerInputManager(in);
63 
64  //Fun4AllDstOutputManager *out_Manager = new Fun4AllDstOutputManager("DSTOUT",output_file);
65  //se->registerOutputManager(out_Manager);
66 
67  se->run(nEvents);
68 
69  se->End();
70 }