Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:21

0001 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0002 #include <fun4all/Fun4AllServer.h>
0003 #include <fun4all/Fun4AllDstOutputManager.h>
0004 #include <fun4all/Fun4AllInputManager.h>
0005 
0006 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0007 
0008 #include <phool/recoConsts.h>
0009 
0010 #include <prototype4/CaloCalibration.h>
0011 #include <prototype4/CaloTemplateFit.h>
0012 #include <prototype4/CaloUnpackPRDF.h>
0013 #include <prototype4/EventInfoSummary.h>
0014 #include <prototype4/GenericUnpackPRDF.h>
0015 #include <prototype4/PROTOTYPE4_FEM.h>
0016 #include <Prototype4DSTReader.h>
0017 #include <prototype4/RunInfoUnpackPRDF.h>
0018 #include <prototype4/TempInfoUnpackPRDF.h>
0019 
0020 R__LOAD_LIBRARY(libfun4allraw.so)
0021 R__LOAD_LIBRARY(libPrototype4.so)
0022 #endif
0023 
0024 void Fun4All_PRDF(int nEvents = 200,
0025                       const char *input_file = "/sphenix/data/data02/sphenix/t1044/production/production_0506/beam_00002099-0000.prdf",
0026                       const char *output_file = "beam_00002099.root")
0027 {
0028   gSystem->Load("libfun4all");
0029   gSystem->Load("libPrototype4.so");
0030 
0031   const bool do_cemc = true;
0032   const bool do_hcal = true;
0033   // const bool do_cemc = false;
0034   //  const bool do_hcal = false;
0035 
0036   Fun4AllServer *se = Fun4AllServer::instance();
0037   // se->Verbosity(Fun4AllServer::VERBOSITY_SOME);
0038   se->Verbosity(0);
0039 
0040   recoConsts *rc = recoConsts::instance();
0041   //rc->set_IntFlag("RUNNUMBER",0);
0042 
0043   // ------------------- Run info -> RUN node -------------------
0044   RunInfoUnpackPRDF *unpack_run = new RunInfoUnpackPRDF();
0045   //  unpack_run->Verbosity(RunInfoUnpackPRDF::VERBOSITY_SOME);
0046 
0047   int i_offset = 0;
0048 
0049   //    rcdaq_client create_device device_filenumbers_delete 9 911 "$HOME/beam_values.txt"
0050   //  S:MTNRG  =  120   GeV
0051   //  F:MT6SC1 =  11127     Cnts
0052   //  F:MT6SC2 =  10585     Cnts
0053   //  F:MT6SC3 =  10442     Cnts
0054   //  F:MT6SC4 =  0         Cnts
0055   //  F:MT6SC5 =  20251     Cnts
0056   //  E:2CH    =  981.9 mm
0057   //  E:2CV    =  93.17 mm
0058   //  E:2CMT6T =  76.11 F
0059   //  E:2CMT6H =  18.09 %Hum
0060   //  F:MT5CP2 =  .0301 Psia
0061   //  F:MT6CP2 =  .6905 Psia
0062   i_offset = 0;
0063   unpack_run->add_channel("beam_MTNRG_GeV", 911, i_offset++, 1e-4);
0064   unpack_run->add_channel("beam_MT6SC1_Cnts", 911, i_offset++, 1e-4);
0065   unpack_run->add_channel("beam_MT6SC2_Cnts", 911, i_offset++, 1e-4);
0066   unpack_run->add_channel("beam_MT6SC3_Cnts", 911, i_offset++, 1e-4);
0067   unpack_run->add_channel("beam_MT6SC4_Cnts", 911, i_offset++, 1e-4);
0068   unpack_run->add_channel("beam_MT6SC5_Cnts", 911, i_offset++, 1e-4);
0069   unpack_run->add_channel("beam_2CH_mm", 911, i_offset++, 1e-4);
0070   unpack_run->add_channel("beam_2CV_mm", 911, i_offset++, 1e-4);
0071   unpack_run->add_channel("beam_2CMT6T_F", 911, i_offset++, 1e-4);
0072   unpack_run->add_channel("beam_2CMT6H_RH", 911, i_offset++, 1e-4);
0073   unpack_run->add_channel("beam_MT5CP2_Psia", 911, i_offset++, 1e-4);
0074   unpack_run->add_channel("beam_MT6CP2_Psia", 911, i_offset++, 1e-4);
0075 
0076   //  rcdaq_client create_device device_filenumbers_delete 9 984 "$HOME/DB_LOGGER_EMCAL_A0_values.txt"
0077   unpack_run->add_channel("EMCAL_A0_HighGain", 984, 0, 1);  // 1: pre-amp high gain, 0: nominal gain
0078 
0079   //  rcdaq_client create_device device_filenumbers_delete 9 983 "$HOME/DB_LOGGER_EMCAL_GR0.txt"
0080   unpack_run->add_channel("EMCAL_GR0_BiasOffset_Tower21", 983, 21 - 1, 1);  // bias offset in mV for tower 21
0081 
0082   // rcdaq_client create_device device_filenumbers_delete 9 982 "$HOME/DB_LOGGER_EMCAL_T0_values.txt"
0083   unpack_run->add_channel("EMCAL_T0_Tower21", 982, 21 - 1, 1e-3);  // temperature reading in C for tower 21
0084   //
0085   se->registerSubsystem(unpack_run);
0086   //
0087   // ------------------- Temperature output -------------------
0088   //  TempInfoUnpackPRDF *unpack_temp = new TempInfoUnpackPRDF();
0089   //  unpack_temp->Verbosity(RunInfoUnpackPRDF::VERBOSITY_SOME);
0090   //  se->registerSubsystem(unpack_temp);
0091 
0092   // ------------------- HCal and EMcal -------------------
0093 
0094   CaloCalibration *calib = NULL;
0095   CaloTemplateFit *calib_cemc = NULL;
0096 
0097   if (do_cemc)
0098   {
0099     SubsysReco *unpack = new CaloUnpackPRDF();
0100     //  unpack->Verbosity(1);
0101     se->registerSubsystem(unpack);
0102 
0103     calib_cemc = new CaloTemplateFit("CEMC");
0104     calib_cemc->set_nthreads(1);
0105     calib_cemc->set_nsamples(12);
0106     calib_cemc->set_templatefile("/gpfs/mnt/gpfs02/sphenix/user/trinn/fitting_algorithm_playing/prdfcode/prototype/offline/packages/Prototype4/templates.root");
0107     //    calib->Verbosity(4);
0108     //    calib->GetCalibrationParameters().set_double_param("calib_const_scale", 8. / 3000);
0109     //    calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 0);
0110     calib_cemc->GetCalibrationParameters().ReadFromFile("CEMC", "xml", 0, 0,
0111                                                    string(getenv("CALIBRATIONROOT")) + string("/Prototype4/Calibration/"));  // calibration database
0112     se->registerSubsystem(calib_cemc);
0113   }
0114 
0115   if (do_hcal)
0116   {
0117     // leading order energy scale from Xu Sun
0118     const double cin_cali = 0.00270145;
0119     const double cout_cali = 0.0065718;
0120 
0121     calib = new CaloCalibration("HCALIN");
0122     calib->set_calib_tower_node_prefix("CALIB_LG");
0123     calib->set_raw_tower_node_prefix("RAW_LG");
0124     calib->GetCalibrationParameters().set_name("hcalin_lg");
0125 //    calib->GetCalibrationParameters().set_double_param("calib_const_scale", cin_cali);
0126 //    calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 0);
0127       calib->GetCalibrationParameters().ReadFromFile("hcalin_lg", "xml", 0, 0,
0128                                                      string(getenv("CALIBRATIONROOT")) + string("/Prototype4/Calibration/"));  // calibration database
0129     se->registerSubsystem(calib);
0130 
0131     //  calib = new CaloCalibration("HCALIN");
0132     //  calib->set_calib_tower_node_prefix("CALIB_HG");
0133     //  calib->set_raw_tower_node_prefix("RAW_HG");
0134     //  calib->GetCalibrationParameters().set_name("hcalin_hg");
0135     //  calib->GetCalibrationParameters().ReadFromFile("hcalin_hg", "xml", 0, 0,
0136     //                                                 string(getenv("CALIBRATIONROOT")) + string("/Prototype4/Calibration/"));  // calibration database
0137     //  se->registerSubsystem(calib);
0138 
0139     calib = new CaloCalibration("HCALOUT");
0140     calib->set_calib_tower_node_prefix("CALIB_LG");
0141     calib->set_raw_tower_node_prefix("RAW_LG");
0142     calib->GetCalibrationParameters().set_name("hcalout_lg");
0143 //    calib->GetCalibrationParameters().set_double_param("calib_const_scale", cout_cali);
0144 //    calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 0);
0145       calib->GetCalibrationParameters().ReadFromFile("hcalout_lg", "xml", 0, 0,
0146                                                      string(getenv("CALIBRATIONROOT")) + string("/Prototype4/Calibration/"));  // calibration database
0147     se->registerSubsystem(calib);
0148 
0149     calib = new CaloCalibration("HCALOUT");
0150     calib->set_calib_tower_node_prefix("CALIB_HG");
0151     calib->set_raw_tower_node_prefix("RAW_HG");
0152     calib->GetCalibrationParameters().set_name("hcalout_hg");
0153 //    calib->GetCalibrationParameters().set_double_param("calib_const_scale", cout_cali / 32);
0154 //    calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 0);
0155       calib->GetCalibrationParameters().ReadFromFile("hcalout_hg", "xml", 0, 0,
0156                                                      string(getenv("CALIBRATIONROOT")) + string("/Prototype4/Calibration/"));  // calibration database
0157     se->registerSubsystem(calib);
0158   }
0159   //
0160   //  // ------------------- Hodoscpes -------------------
0161   //
0162   const int first_packet_id = PROTOTYPE4_FEM::PACKET_ID;
0163   //  const int second_packet_id = 21102;
0164   //
0165   GenericUnpackPRDF *gunpack = NULL;
0166 
0167   const int N_hodo = 8;
0168   // mapping based on SPHENIX-doc-121-v6
0169   //  1 2 3 4 5 6 7 8
0170   //  101 100 103 102 97  96  99  98
0171   //
0172   //9 109
0173   //10  108
0174   //11  111
0175   //12  110
0176   //13  105
0177   //14  104
0178   //15  107
0179   //16  106
0180 
0181   gunpack = new GenericUnpackPRDF("HODO_VERTICAL");
0182   gunpack->add_channel(first_packet_id, 101, 0);
0183   gunpack->add_channel(first_packet_id, 100, 1);
0184   gunpack->add_channel(first_packet_id, 103, 2);
0185   gunpack->add_channel(first_packet_id, 102, 3);
0186   gunpack->add_channel(first_packet_id, 97, 4);
0187   gunpack->add_channel(first_packet_id, 96, 5);
0188   gunpack->add_channel(first_packet_id, 99, 6);
0189   gunpack->add_channel(first_packet_id, 98, 7);
0190   se->registerSubsystem(gunpack);
0191   //
0192   gunpack = new GenericUnpackPRDF("HODO_HORIZONTAL");
0193   gunpack->add_channel(first_packet_id, 109, 0);
0194   gunpack->add_channel(first_packet_id, 108, 1);
0195   gunpack->add_channel(first_packet_id, 111, 2);
0196   gunpack->add_channel(first_packet_id, 110, 3);
0197   gunpack->add_channel(first_packet_id, 105, 4);
0198   gunpack->add_channel(first_packet_id, 104, 5);
0199   gunpack->add_channel(first_packet_id, 107, 6);
0200   gunpack->add_channel(first_packet_id, 106, 7);
0201   se->registerSubsystem(gunpack);
0202   //
0203 
0204   //  Nicole Lewis [7:12 PM]
0205   //  added and commented on this Plain Text snippet: Run 545 MPV and Other Values
0206   //  Collumns: Height, MPV, Sigma, chi2, NDF
0207   //  Run 545
0208   //  HODO_HORIZONTAL[0] 18.0525 319.879 83.4359 139.487 199
0209   //  HODO_HORIZONTAL[1] 26.6811 262.209 65.1704 159.059 171
0210   //  HODO_HORIZONTAL[2] 27.5885 296.343 61.0538 171.291 205
0211   //  HODO_HORIZONTAL[3] 24.4132 299.135 72.4796 205.008 214
0212   //  HODO_HORIZONTAL[4] 28.6331 290.498 66.9209 177.386 205
0213   //  HODO_HORIZONTAL[5] 29.3528 263.781 61.5052 202.933 195
0214   //  HODO_HORIZONTAL[6] 21.5175 336.446 78.8985 170.031 206
0215   //  HODO_HORIZONTAL[7] 17.7948 336.247 91.8477 146.352 201
0216   //  HODO_VERTICAL[0] 15.3648 238.473 94.6679 111.272 166
0217   //  HODO_VERTICAL[1] 23.2368 225.202 54.8611 117.209 145
0218   //  HODO_VERTICAL[2] 25.3442 209.827 66.168 134.383 171
0219   //  HODO_VERTICAL[3] 36.8254 217.544 44.1445 122.811 167
0220   //  HODO_VERTICAL[4] 38.0982 210.6   44.9922 160.269 165
0221   //  HODO_VERTICAL[5] 38.1045 252.022 49.4073 165.239 200
0222   //  HODO_VERTICAL[6] 42.1052 223.528 44.5291 113.343 171
0223   //  HODO_VERTICAL[7] 31.1721 244.299 55.974 160.476 186
0224 
0225   calib = new CaloCalibration("HODO_VERTICAL");
0226   calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 1);
0227   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 0), 1 / 238.473);  // normalize to 1.0
0228   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 1), 1 / 225.202);  // normalize to 1.0
0229   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 2), 1 / 209.827);  // normalize to 1.0
0230   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 3), 1 / 217.544);  // normalize to 1.0
0231   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 4), 1 / 210.6);    // normalize to 1.0
0232   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 5), 1 / 252.022);  // normalize to 1.0
0233   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 6), 1 / 223.528);  // normalize to 1.0
0234   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 7), 1 / 244.299);  // normalize to 1.0
0235   se->registerSubsystem(calib);
0236 
0237   calib = new CaloCalibration("HODO_HORIZONTAL");
0238   calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 1);
0239   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 0), 1 / 319.879);  // normalize to 1.0
0240   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 1), 1 / 262.209);  // normalize to 1.0
0241   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 2), 1 / 296.343);  // normalize to 1.0
0242   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 3), 1 / 299.135);  // normalize to 1.0
0243   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 4), 1 / 290.498);  // normalize to 1.0
0244   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 5), 1 / 263.781);  // normalize to 1.0
0245   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 6), 1 / 336.446);  // normalize to 1.0
0246   calib->GetCalibrationParameters().set_double_param(Form("calib_const_column0_row%d", 7), 1 / 336.247);  // normalize to 1.0
0247   se->registerSubsystem(calib);
0248   //
0249   //  // ------------------- Other detectors -------------------
0250   //
0251   // mapping based on SPHENIX-doc-121-v6
0252   gunpack = new GenericUnpackPRDF("C1");
0253   // unpack->Verbosity(1);
0254   gunpack->add_channel(first_packet_id, 165, 0);  // 24 Cerenkov 1
0255   se->registerSubsystem(gunpack);
0256   //
0257   calib = new CaloCalibration("C1");
0258   calib->SetFitType(CaloCalibration::kPeakSample);
0259   se->registerSubsystem(calib);
0260   //
0261   // mapping based on SPHENIX-doc-121-v6
0262   gunpack = new GenericUnpackPRDF("C2");
0263   // unpack->Verbosity(1);
0264   gunpack->add_channel(first_packet_id, 166, 0);   // C2 inner fast
0265   gunpack->add_channel(first_packet_id, 160, 1);   // C2 outer fast
0266   gunpack->add_channel(first_packet_id, 167, 10);  // C2 inner slow
0267   se->registerSubsystem(gunpack);
0268   //
0269   calib = new CaloCalibration("C2");
0270   calib->SetFitType(CaloCalibration::kPeakSample);
0271   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0272   calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 1);
0273   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row0", 1);
0274   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row1", 1);
0275   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row10", 1);
0276   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row11", 1);
0277   se->registerSubsystem(calib);
0278   //
0279   ////  John H. : should be 19, 20, 21 and the other channels are a litle permuted from  what I thought
0280   //  gunpack = new GenericUnpackPRDF("HCAL_SCINT");
0281   //// unpack->Verbosity(1);
0282   //  gunpack->add_channel(second_packet_id, 19, 1);
0283   //  gunpack->add_channel(second_packet_id, 20, 2);
0284   //  gunpack->add_channel(second_packet_id, 21, 3);
0285   //  se->registerSubsystem(gunpack);
0286   //
0287   //  calib = new CaloCalibration("HCAL_SCINT");
0288   //  se->registerSubsystem(calib);
0289   //
0290   // mapping based on SPHENIX-doc-121-v6
0291   gunpack = new GenericUnpackPRDF("PbGL");
0292   // unpack->Verbosity(1);
0293   gunpack->add_channel(first_packet_id, 171, 0);  // PbGl (612AM-3)
0294   se->registerSubsystem(gunpack);
0295 
0296   calib = new CaloCalibration("PbGL");
0297   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0298   se->registerSubsystem(calib);
0299   //
0300   // mapping based on SPHENIX-doc-121-v6
0301   gunpack = new GenericUnpackPRDF("TRIGGER_VETO");
0302   // unpack->Verbosity(1);
0303   gunpack->add_channel(first_packet_id, 172, 0);  //  172 Counters  Bottom veto
0304   gunpack->add_channel(first_packet_id, 173, 1);  //  173 Counters  Top veto
0305   gunpack->add_channel(first_packet_id, 174, 2);  //  174 Counters  Right veto
0306   gunpack->add_channel(first_packet_id, 175, 3);  //  175 Counters  Left Veto
0307   se->registerSubsystem(gunpack);
0308 
0309   // Calibrate the MIP peak to an relative energy of +1.0
0310 
0311   //  Nicole Lewis [7:12 PM]
0312   //  added and commented on this Plain Text snippet: Run 545 MPV and Other Values
0313   //  Collumns: Height, MPV, Sigma, chi2, NDF
0314   //  Run 545
0315   //  TRIGGER_VETO[0] 501.958 295.811 51.6134 223.972 194
0316   //  TRIGGER_VETO[1] 262.321 305.247 52.5851 138.403 158
0317   //  TRIGGER_VETO[2] 238.726 451.48 99.6016 274.339 245
0318   //  TRIGGER_VETO[3] 135.541 624.076 132.313 284.532 240
0319 
0320   calib = new CaloCalibration("TRIGGER_VETO");
0321   calib->SetFitType(CaloCalibration::kPeakSample);
0322   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0323   calib->GetCalibrationParameters().set_int_param("use_chan_calibration", 1);
0324   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row0", 1. / 295.811);
0325   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row1", 1. / 305.247);
0326   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row2", 1. / 451.48);
0327   calib->GetCalibrationParameters().set_double_param("calib_const_column0_row3", 1. / 624.076);
0328   se->registerSubsystem(calib);
0329   //
0330   const int N_TileMapper = 16;
0331   //
0332   gunpack = new GenericUnpackPRDF("TILE_MAPPER");
0333   for (int i = 0; i < N_TileMapper; ++i)
0334     gunpack->add_channel(first_packet_id, 176 + i, i);  // 24 Cerenkov 1
0335   se->registerSubsystem(gunpack);
0336   //
0337   calib = new CaloCalibration("TILE_MAPPER");
0338   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0339   se->registerSubsystem(calib);
0340   //
0341   // mapping based on SPHENIX-doc-121-v6
0342   gunpack = new GenericUnpackPRDF("SC3");
0343   // unpack->Verbosity(1);
0344   gunpack->add_channel(first_packet_id, 169, 0);  // MT6SC3 (612AM-2)
0345   se->registerSubsystem(gunpack);
0346   //
0347   calib = new CaloCalibration("SC3");
0348   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0349   se->registerSubsystem(calib);
0350 
0351   gunpack = new GenericUnpackPRDF("FINGER_COUNTER");
0352   // unpack->Verbosity(1);
0353   gunpack->add_channel(first_packet_id, 168, 0);  // 168  Counters  Finger counter
0354   se->registerSubsystem(gunpack);
0355   //
0356   calib = new CaloCalibration("FINGER_COUNTER");
0357   calib->GetCalibrationParameters().set_double_param("calib_const_scale", 1);
0358   se->registerSubsystem(calib);
0359   //
0360   //  gunpack = new GenericUnpackPRDF("SC_MWPC4");
0361   //// unpack->Verbosity(1);
0362   //  gunpack->add_channel(second_packet_id, 18, 0); // 18  SC behind MWPC4 From channel 4 of adjacent 612AM amplifier
0363   //  se->registerSubsystem(gunpack);
0364   //
0365   //  calib = new CaloCalibration("SC_MWPC4");
0366   //  calib->GetCalibrationParameters().set_double_param("calib_const_scale", -1);
0367   //  se->registerSubsystem(calib);
0368   //
0369   //  gunpack = new GenericUnpackPRDF("SPILL_WARBLER");
0370   //// unpack->Verbosity(1);
0371   //  gunpack->add_channel(second_packet_id, 16, 0); // Short Meritec cable 0 16  Spill warbler
0372   //  se->registerSubsystem(gunpack);
0373   //
0374   //  // -------------------  Event summary -------------------
0375   //
0376   //  EventInfoSummary * es = new EventInfoSummary();
0377   //  es->Verbosity(EventInfoSummary::VERBOSITY_MORE);
0378   //  se->registerSubsystem(es);
0379 
0380   // -------------------  Output -------------------
0381   //main DST output
0382   Fun4AllDstOutputManager *out_Manager = new Fun4AllDstOutputManager("DSTOUT",
0383                                                                      output_file);
0384   se->registerOutputManager(out_Manager);
0385 
0386   //alternatively, fast check on DST using DST Reader:
0387   Prototype4DSTReader *reader = new Prototype4DSTReader(
0388       string(output_file) + string("_DSTReader.root"));
0389 
0390   reader->AddRunInfo("beam_MTNRG_GeV");
0391   reader->AddRunInfo("beam_2CH_mm");
0392   reader->AddRunInfo("beam_2CV_mm");
0393   reader->AddRunInfo("EMCAL_A0_HighGain");
0394   reader->AddRunInfo("EMCAL_GR0_BiasOffset_Tower21");
0395   reader->AddRunInfo("EMCAL_T0_Tower21");
0396   reader->AddRunInfo("EMCAL_Is_HighEta");
0397 
0398   //  reader->AddEventInfo("beam_Is_In_Spill");
0399   //  reader->AddEventInfo("beam_SPILL_WARBLER_RMS");
0400   //  reader->AddEventInfo("CALIB_CEMC_Sum");
0401   //  reader->AddEventInfo("CALIB_LG_HCALIN_Sum");
0402   //  reader->AddEventInfo("CALIB_LG_HCALOUT_Sum");
0403   //
0404   if (do_hcal)
0405   {
0406     reader->AddTower("RAW_LG_HCALIN");
0407     //  reader->AddTower("RAW_HG_HCALIN");
0408     reader->AddTower("RAW_LG_HCALOUT");
0409     reader->AddTower("RAW_HG_HCALOUT");
0410 
0411     reader->AddTower("CALIB_LG_HCALIN");
0412     //  reader->AddTower("CALIB_HG_HCALIN");
0413     reader->AddTower("CALIB_LG_HCALOUT");
0414     reader->AddTower("CALIB_HG_HCALOUT");
0415   }
0416 
0417   if (do_cemc)
0418   {
0419     reader->AddTower("RAW_CEMC");
0420     reader->AddTower("CALIB_CEMC");
0421   }
0422 
0423   //
0424   reader->AddTower("RAW_HODO_VERTICAL");
0425   reader->AddTower("RAW_HODO_HORIZONTAL");
0426   reader->AddTower("CALIB_HODO_VERTICAL");
0427   reader->AddTower("CALIB_HODO_HORIZONTAL");
0428   //
0429   reader->AddTower("RAW_C1");
0430   reader->AddTower("CALIB_C1");
0431 
0432   reader->AddTower("RAW_C2");
0433   reader->AddTower("CALIB_C2");
0434   //
0435   //  reader->AddTower("RAW_HCAL_SCINT");
0436   //  reader->AddTower("CALIB_HCAL_SCINT");
0437   //
0438   reader->AddTower("RAW_PbGL");
0439   reader->AddTower("CALIB_PbGL");
0440   //
0441   reader->AddTower("RAW_TRIGGER_VETO");
0442   reader->AddTower("CALIB_TRIGGER_VETO");
0443   //
0444   reader->AddTower("RAW_TILE_MAPPER");
0445   reader->AddTower("CALIB_TILE_MAPPER");
0446   //
0447   reader->AddTower("RAW_SC3");
0448   reader->AddTower("CALIB_SC3");
0449 
0450   reader->AddTower("RAW_FINGER_COUNTER");
0451   reader->AddTower("CALIB_FINGER_COUNTER");
0452 
0453   //
0454   //  reader->AddTower("RAW_SC_MWPC4");
0455   //  reader->AddTower("CALIB_SC_MWPC4");
0456   //
0457   //  reader->AddTower("RAW_SPILL_WARBLER");
0458 
0459   //  reader->AddTowerTemperature("EMCAL");
0460   //  reader->AddTowerTemperature("HCALIN");
0461   //  reader->AddTowerTemperature("HCALOUT");
0462 
0463   se->registerSubsystem(reader);
0464 
0465   Fun4AllInputManager *in = new Fun4AllPrdfInputManager("PRDFin");
0466   in->fileopen(input_file);
0467   se->registerInputManager(in);
0468 
0469   se->run(nEvents);
0470 
0471   se->End();
0472 }