• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

beamtime/tof-tdctest/go4/ROOTCONV/TRootConverterParam.cxx (r4864/r4267)

Go to the documentation of this file.
00001 /* Generated by Together */
00002 
00003 #include "TRootConverterParam.h"
00004 #include "TGo4Version.h"
00005 #if __GO4BUILDVERSION__ > 40502
00006    #include "go4iostream.h"
00007 #else
00008    #include "Riostream.h"
00009 #endif
00010 
00011 /***** Default values definition *****/
00012 #define OUTPUT_FILE_ENABLE     0
00013 #define OUTPUT_FILENAME    "testTree.root"
00014 #define ROOT_TREE_DISPLAY      0
00015 #define EVNT_BEF_RESET         5000
00016 
00017 #define TRIGLOG_DATA_IN_TREE   0
00018 #define TRIGLOG_FULL_EVENT     0
00019 
00020 #define CAEN_DATA_IN_TREE      0
00021 #define CAEN_TDC_MODE          1
00022 #define CAEN_TDC_MUTLTI        0
00023 #define CAEN_TDC_GENERAL_ENA   0
00024 #define PMT_TDC               -1
00025 #define PMT_QDC               -1
00026 #define RPC_TDC_LEADING       -1
00027 #define RPC_TDC_LEADING       -1
00028 
00029 #define VFTX_DATA_IN_TREE      0
00030 #define VFTX_FULL_BOARD_DATA   0
00031 #define VFTX_FULL_DATA_MODE    0
00032 #define VFTX_ENABLE            0
00033 
00034 #define GET4_DATA_IN_TREE      0
00035 #define MULTI_EVENTS_ALLOWED   0
00036 #define GET4_ENABLE            0
00037 #define TDC_REFERENCE         -1
00038 #define CHANNEL_TDC_REFERENCE -1
00039 
00040 #define RPC_IN_TREE            0
00041 #define RPC_ENABLE             0
00042 
00043 #define HDRPC_IN_TREE          0
00044 #define BUCRPC_IN_TREE         0
00045 #define BUCMOD1RPC_IN_TREE     0
00046 #define BUCMOD2RPC_IN_TREE     0
00047 #define BUCMOD3RPC_IN_TREE     0
00048 #define BUCMOD4RPC_IN_TREE     0
00049 
00050 
00051 #define PLASTICS_IN_TREE       0
00052 #define PLASTICS_ENABLE        0
00053 
00054 #define PADRPC_IN_TREE         0
00055 
00056 #define SCALORMU_IN_TREE       0
00057 #define SCALORMU2_IN_TREE      0
00058 
00059 #define MATCHING_IN_TREE       0
00060 
00061 #define HODOSCOPE_DATA_IN_TREE 0
00062 #define HODOSCOPE_DEBUG_HISTO  0
00063 
00064 #define SLOW_CONTROL_IN_TREE   0
00065 #define NB_SLOW_CONTROL_CH     0
00066 /*************************************/
00067 
00068 //***********************************************************
00069 TRootConverterParam::TRootConverterParam() : TGo4Parameter()
00070 {
00071    // Loading default values for safety
00072    uRootDisplay         = ROOT_TREE_DISPLAY;     // No Online Change - Enable/Disable root tree display in GO4 interface
00073    uCleanOuputEnable    = OUTPUT_FILE_ENABLE;    // No Online Change - Enable/Disable the generation of a cleaned data output file
00074    uEventsUntilReset    = EVNT_BEF_RESET;        // When tree displayed but not saved, number of events in Tree before periodic reset
00075    sOutputFilename      = OUTPUT_FILENAME;       // No Online Change - Filename for the output of the Cleanning/Unpack step
00076 
00077    // TRIGLOG
00078    uTriglogInputInTree  = TRIGLOG_DATA_IN_TREE;  // No Online Change - Enable/Disable the triglog input scalers data in the TTree root output
00079    uTriglogFullEvent    = TRIGLOG_FULL_EVENT;    // No Online Change - Save full Triglog event instead of only selected info
00080 
00081    // CAEN TDC general mode
00082    uCaenInTree          = CAEN_DATA_IN_TREE;     // TODO No Online Change - Enable/Disable the CAEN TDC data in the TTree root output
00083    uCaenMode            = CAEN_TDC_MODE;         // No Online Change - Caen Output mode
00084    uCaenMulti           = CAEN_TDC_MUTLTI;       // No Online Change - Enable/disable multi hits support for caen in general mode
00085    // CAEN TDC Cosy like mode
00086    iPmtTdc              = PMT_TDC;               // Index of the Caen TDC containing the PMT data
00087    iPmtQdc              = PMT_QDC;               // Index of the Lecroy Qdc containing the PMT data
00088    iRpcTdcLeading       = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC leading  edge data
00089    iRpcTdcTrailing      = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC trailing edge data
00090 
00091    // VFTX
00092    uVftxInTree          = VFTX_DATA_IN_TREE;     // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00093    uVftxFullBoardData   = VFTX_FULL_BOARD_DATA;  // No Online Change - Enable/Disable the full board object in tree instead of single variables
00094    uVftxFullDataMode    = VFTX_FULL_DATA_MODE;   // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00095 
00096    // GET4 v1.0
00097    uGet4InTree          = GET4_DATA_IN_TREE;     // No Online Change - Enable/Disable the Get4 data in the TTree root output
00098    uMultiEventsAllowed  = MULTI_EVENTS_ALLOWED;  // No Online Change - if 0 only first event per MBS event is saved, even if multiple ones
00099    iReferenceTdc        = TDC_REFERENCE;         // Index of the Caen TDC containing the t0 hybrid reference time
00100    iReferenceChannel1   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00101    iReferenceChannel2   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00102 
00103    // RPC
00104    uRpcInTree          = RPC_IN_TREE;            // No Online Change - Enable/Disable the Plastics data in the TTree root output
00105 
00106    // Plastics
00107    uPlasticsInTree     = PLASTICS_IN_TREE;       // No Online Change - Enable/Disable the Plastics data in the TTree root output
00108 
00109    // Pad RPC
00110    uPadRpcInTree       = PADRPC_IN_TREE;         // No Online Change - Enable/Disable the Pad Rpc data in the TTree root output
00111 
00112    // SCALORMU
00113    uScalOrMuInTree     = SCALORMU_IN_TREE;      // No Online Change - Enable/Disable the Scaler Or Multiplicity scaler data in TTree root output
00114    uScalOrMu2InTree    = SCALORMU2_IN_TREE;     // TODO No Online Change - Enable/Disable the second ScalOrMu data in TTree root output
00115 
00116    // Matching
00117    uMatchingInTree     = MATCHING_IN_TREE;      // No Online Change - Enable/Disable the Matching data in the TTree root output
00118 
00119    // Hodoscope
00120    uHodoInputInTree     = HODOSCOPE_DATA_IN_TREE;// No Online Change - Enable/Disable the fiber hodoscope data in the TTree root output
00121    uHodoDebugHisto      = HODOSCOPE_DEBUG_HISTO; // No Online Change - Enable/Disable the fiber hodoscope debug histograms
00122 
00123    // Slow control
00124    uSlowControlInTree   = SLOW_CONTROL_IN_TREE;  // No Online Change - Enable/Disable inclusion of slow control data for HDRPC in Tree
00125    uNbSlowControlChan   = NB_SLOW_CONTROL_CH;    // No Online Change - Number of HV channels Slow Control to be saved in the tree
00126 }
00127 
00128 
00129 //***********************************************************
00130 TRootConverterParam::TRootConverterParam(const char* name) : TGo4Parameter(name)
00131 {
00132    // Loading default values for safety
00133    uRootDisplay         = ROOT_TREE_DISPLAY;     // No Online Change - Enable/Disable root tree display in GO4 interface
00134    uCleanOuputEnable    = OUTPUT_FILE_ENABLE;    // No Online Change - Enable/Disable the generation of a cleaned data output file
00135    uEventsUntilReset    = EVNT_BEF_RESET;        // When tree displayed but not saved, number of events in Tree before periodic reset
00136    sOutputFilename      = OUTPUT_FILENAME;       // No Online Change - Filename for the output of the Cleanning/Unpack step
00137 
00138    // TRIGLOG
00139    uTriglogInputInTree  = TRIGLOG_DATA_IN_TREE;  // No Online Change - Enable/Disable the triglog input scalers data in the TTree root output
00140    uTriglogFullEvent    = TRIGLOG_FULL_EVENT;    // No Online Change - Save full Triglog event instead of only selected info
00141 
00142    // CAEN TDC general mode
00143    uCaenInTree          = CAEN_DATA_IN_TREE;     // TODO No Online Change - Enable/Disable the CAEN TDC data in the TTree root output
00144    uCaenMode            = CAEN_TDC_MODE;         // No Online Change - Caen Output mode
00145    uCaenMulti           = CAEN_TDC_MUTLTI;       // No Online Change - Enable/disable multi hits support for caen in general mode
00146    // CAEN TDC Cosy like mode
00147    iPmtTdc              = PMT_TDC;               // Index of the Caen TDC containing the PMT data
00148    iPmtQdc              = PMT_QDC;               // Index of the Lecroy Qdc containing the PMT data
00149    iRpcTdcLeading       = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC leading  edge data
00150    iRpcTdcTrailing      = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC trailing edge data
00151 
00152    // VFTX
00153    uVftxInTree          = VFTX_DATA_IN_TREE;     // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00154    uVftxFullBoardData   = VFTX_FULL_BOARD_DATA;  // No Online Change - Enable/Disable the full board object in tree instead of single variables
00155    uVftxFullDataMode    = VFTX_FULL_DATA_MODE;   // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00156 
00157    // GET4 v1.0
00158    uGet4InTree          = GET4_DATA_IN_TREE;     // No Online Change - Enable/Disable the Get4 data in the TTree root output
00159    uMultiEventsAllowed  = MULTI_EVENTS_ALLOWED;  // No Online Change - if 0 only first event per MBS event is saved, even if multiple ones
00160    iReferenceTdc        = TDC_REFERENCE;         // Index of the Caen TDC containing the t0 hybrid reference time
00161    iReferenceChannel1   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00162    iReferenceChannel2   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00163 
00164    // RPC
00165    uRpcInTree          = RPC_IN_TREE;            // No Online Change - Enable/Disable the Plastics data in the TTree root output
00166 
00167    // Plastics
00168    uPlasticsInTree     = PLASTICS_IN_TREE;       // No Online Change - Enable/Disable the Plastics data in the TTree root output
00169 
00170    // Pad RPC
00171    uPadRpcInTree       = PADRPC_IN_TREE;         // No Online Change - Enable/Disable the Pad Rpc data in the TTree root output
00172 
00173    // SCALORMU
00174    uScalOrMuInTree     = SCALORMU_IN_TREE;      // No Online Change - Enable/Disable the Scaler Or Multiplicity scaler data in TTree root output
00175    uScalOrMu2InTree    = SCALORMU2_IN_TREE;     // TODO No Online Change - Enable/Disable the second ScalOrMu data in TTree root output
00176 
00177    // Matching
00178    uMatchingInTree     = MATCHING_IN_TREE;      // No Online Change - Enable/Disable the Matching data in the TTree root output
00179 
00180    // Hodoscope
00181    uHodoInputInTree     = HODOSCOPE_DATA_IN_TREE;// No Online Change - Enable/Disable the fiber hodoscope data in the TTree root output
00182    uHodoDebugHisto      = HODOSCOPE_DEBUG_HISTO; // No Online Change - Enable/Disable the fiber hodoscope debug histograms
00183 
00184    // Slow control
00185    uSlowControlInTree   = SLOW_CONTROL_IN_TREE;  // No Online Change - Enable/Disable inclusion of slow control data for HDRPC in Tree
00186    uNbSlowControlChan   = NB_SLOW_CONTROL_CH;    // No Online Change - Number of HV channels Slow Control to be saved in the tree
00187 
00188    ReadOptions();
00189    this->PrintOptions();
00190 }
00191 //***********************************************************
00192 
00193 TRootConverterParam::~TRootConverterParam()
00194 {
00195 }
00196 //-----------------------------------------------------------
00197 Bool_t TRootConverterParam::UpdateFrom(TGo4Parameter *pp)
00198 {
00199   if(pp->InheritsFrom("TRootConverterParam")) {
00200      TRootConverterParam * from = (TRootConverterParam *) pp;
00201      cout << "**** TRootConverterParam " << GetName() << " updated from source parameter" << endl;
00202   } else
00203      cout << "Wrong parameter object: " << pp->ClassName() << endl;
00204   return kTRUE;
00205 }
00206 
00207 Bool_t TRootConverterParam::ReadOptions()
00208 {
00209    // Loading default values for safety
00210    uRootDisplay         = ROOT_TREE_DISPLAY;     // No Online Change - Enable/Disable root tree display in GO4 interface
00211    uCleanOuputEnable    = OUTPUT_FILE_ENABLE;    // No Online Change - Enable/Disable the generation of a cleaned data output file
00212    uEventsUntilReset    = EVNT_BEF_RESET;        // When tree displayed but not saved, number of events in Tree before periodic reset
00213    sOutputFilename      = OUTPUT_FILENAME;       // No Online Change - Filename for the output of the Cleanning/Unpack step
00214 
00215    // TRIGLOG
00216    uTriglogInputInTree  = TRIGLOG_DATA_IN_TREE;  // No Online Change - Enable/Disable the triglog input scalers data in the TTree root output
00217    uTriglogFullEvent    = TRIGLOG_FULL_EVENT;    // No Online Change - Save full Triglog event instead of only selected info
00218 
00219    // CAEN TDC general mode
00220    uCaenInTree          = CAEN_DATA_IN_TREE;     // TODO No Online Change - Enable/Disable the CAEN TDC data in the TTree root output
00221    uCaenMode            = CAEN_TDC_MODE;         // No Online Change - Caen Output mode
00222    uCaenMulti           = CAEN_TDC_MUTLTI;       // No Online Change - Enable/disable multi hits support for caen in general mode
00223    for(UInt_t temp_index = 0; temp_index < MAX_HV_CHAN_SC; temp_index++)
00224       uGeneralCaenTdcEnabled[temp_index] = CAEN_TDC_GENERAL_ENA;
00225    // CAEN TDC Cosy like mode
00226    iPmtTdc              = PMT_TDC;               // Index of the Caen TDC containing the PMT data
00227    iPmtQdc              = PMT_QDC;               // Index of the Lecroy Qdc containing the PMT data
00228    iRpcTdcLeading       = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC leading  edge data
00229    iRpcTdcTrailing      = RPC_TDC_LEADING;       // Index of the Caen TDC containing the RPC trailing edge data
00230 
00231    // VFTX
00232    uVftxInTree          = VFTX_DATA_IN_TREE;     // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00233    uVftxFullBoardData   = VFTX_FULL_BOARD_DATA;  // No Online Change - Enable/Disable the full board object in tree instead of single variables
00234    uVftxFullDataMode    = VFTX_FULL_DATA_MODE;   // No Online Change - Enable/Disable the Vftx (Fpga TDC) data in the TTree root output
00235    for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC; temp_index++)
00236       uVftxEnabled[temp_index] = VFTX_ENABLE;
00237 
00238    // GET4 v1.0
00239    uGet4InTree          = GET4_DATA_IN_TREE;     // No Online Change - Enable/Disable the Get4 data in the TTree root output
00240    uMultiEventsAllowed  = MULTI_EVENTS_ALLOWED;  // No Online Change - if 0 only first event per MBS event is saved, even if multiple ones
00241    for(UInt_t temp_index = 0; temp_index < MAX_GET4; temp_index++)
00242       uGet4Enabled[temp_index] = GET4_ENABLE;
00243    iReferenceTdc        = TDC_REFERENCE;         // Index of the Caen TDC containing the t0 hybrid reference time
00244    iReferenceChannel1   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00245    iReferenceChannel2   = CHANNEL_TDC_REFERENCE; // Index of the channel containing the t0 hybrid reference time
00246 
00247    // RPC
00248    uRpcInTree          = RPC_IN_TREE;            // No Online Change - Enable/Disable the Plastics data in the TTree root output
00249    for(UInt_t temp_index = 0; temp_index < NB_RPC; temp_index++)
00250       uRpcEnabled[temp_index] = RPC_ENABLE;
00251 
00252    // Plastics
00253    uPlasticsInTree     = PLASTICS_IN_TREE;       // No Online Change - Enable/Disable the Plastics data in the TTree root output
00254    for(UInt_t temp_index = 0; temp_index < NB_PLASTICS; temp_index++)
00255       uPlasticsEnabled[temp_index] = PLASTICS_ENABLE;
00256 
00257    // Pad RPC
00258    uPadRpcInTree       = PADRPC_IN_TREE;         // No Online Change - Enable/Disable the Pad Rpc data in the TTree root output
00259 
00260    // SCALORMU
00261    uScalOrMuInTree     = SCALORMU_IN_TREE;      // No Online Change - Enable/Disable the Scaler Or Multiplicity scaler data in TTree root output
00262    uScalOrMu2InTree    = SCALORMU2_IN_TREE;     // TODO No Online Change - Enable/Disable the second ScalOrMu data in TTree root output
00263 
00264    // Matching
00265    uMatchingInTree     = MATCHING_IN_TREE;      // No Online Change - Enable/Disable the Matching data in the TTree root output
00266 
00267    // Hodoscope
00268    uHodoInputInTree     = HODOSCOPE_DATA_IN_TREE;// No Online Change - Enable/Disable the fiber hodoscope data in the TTree root output
00269    uHodoDebugHisto      = HODOSCOPE_DEBUG_HISTO; // No Online Change - Enable/Disable the fiber hodoscope debug histograms
00270 
00271    // Slow control
00272    uSlowControlInTree   = SLOW_CONTROL_IN_TREE;  // No Online Change - Enable/Disable inclusion of slow control data for HDRPC in Tree
00273    uNbSlowControlChan   = NB_SLOW_CONTROL_CH;    // No Online Change - Number of HV channels Slow Control to be saved in the tree
00274    for(UInt_t temp_index = 0; temp_index < MAX_HV_CHAN_SC; temp_index++)
00275    {
00276       sScInputNamePosI[temp_index] = "";
00277       sScOutputNamePosI[temp_index]= "";
00278       sScInputNamePosU[temp_index] = "";
00279       sScOutputNamePosU[temp_index]= "";
00280       sScInputNameNegI[temp_index] = "";
00281       sScOutputNameNegI[temp_index]= "";
00282       sScInputNameNegU[temp_index] = "";
00283       sScOutputNameNegU[temp_index]= "";
00284    } // for(UInt_t temp_index = 0; temp_index < MAX_HV_CHAN_SC; temp_index++)
00285 
00286    // Try to read the option filename from the general option files text file
00287    TString sOptionFileName = "./rootconv_options.txt";
00288    Bool_t bFilenameFound = kFALSE;
00289    fstream optionFilenameFile("./Option_files.txt", ios::in);
00290    // Testing if the file does exist. If not I use default values
00291    if( optionFilenameFile.fail() == true)
00292    {
00293       cout<<"************************************************************************"<<endl;
00294       cout<<" File with option filename for Root Conv not found: using the default value ";
00295       cout<<sOptionFileName<<endl;
00296    } // if( optionFilenameFile.fail() == true)
00297       else
00298       {
00299          TString line;
00300 
00301          // Goes through all lines
00302          while( !optionFilenameFile.eof() )
00303          {
00304            line.ReadLine(optionFilenameFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00305 
00306            if(line(0) == '#' || line(0) == '*'||
00307                (line(0) == '/' && line(1) == '/') )
00308            {
00309               //Comment in the text file
00310               ;
00311            }
00312            else if(line.Contains("rootconv")==kTRUE)
00313            {
00314               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00315               cout<<"************************************************************************"<<endl;
00316               cout<<"Using "<<sOptionFileName<<" as source for the options of Root Conv step"<<endl;
00317               bFilenameFound = kTRUE;
00318               break;
00319            }
00320          } // while( !optionFilenameFile.eof() )
00321          if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00322          {
00323             cout<<"************************************************************************"<<endl;
00324             cout<<"Field for Root Conv step not found in File with option filename => Using "<<sOptionFileName<<endl;
00325          } // if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00326       } // else of if( optionFilenameFile.fail() == true)
00327 
00328 
00329    // Reading out parameters from the option file
00330    //~ fstream setupFile("./ROOTFORMAT/rootconv_options.txt", ios::in);
00331    fstream setupFile(sOptionFileName, ios::in);
00332    if( setupFile.fail() == true)
00333    {
00334       cout<<"Error for TRootConverterParam: Setup file "<<sOptionFileName<<" can not be opened or is missing."<<endl;
00335       cout<<"=> Using default values!"<<endl;
00336    }
00337    else
00338    {
00339       TString line;
00340       while( !setupFile.eof() )
00341       {
00342          line.ReadLine(setupFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00343          if(line(0) == '#' || line(0) == '*')
00344          {
00345             //Comment
00346             ;
00347          }
00348          else if(line.Contains("disproot")==kTRUE)
00349          {
00350             uRootDisplay = ((TString)line(8,10)).Atoi();
00351          }
00352          else if(line.Contains("cleanoutp")==kTRUE)
00353          {
00354             uCleanOuputEnable = ((TString)line(10,10)).Atoi();
00355          }
00356          else if(line.Contains("nbevtrst")==kTRUE)
00357          {
00358             uEventsUntilReset = ((TString)line(8,10)).Atoi();
00359          }
00360          else if(line.Contains("cleanfile")==kTRUE)
00361          {
00362             sOutputFilename = line(10,120);
00363          }
00364          else if(line.Contains("get4intree")==kTRUE)
00365          {
00366             uGet4InTree = ((TString)line(11,10)).Atoi();
00367          }
00368          else if(line.Contains("get4mulevt")==kTRUE)
00369          {
00370             uMultiEventsAllowed = ((TString)line(11,10)).Atoi();
00371          }
00372          else if(line.Contains("get4enable")==kTRUE)
00373          {
00374             line = line(11, 3*MAX_GET4);
00375             if( 0 != line.Sizeof() )
00376             {
00377                for(UInt_t temp_index = 0; temp_index < MAX_GET4 && 0 != line.Sizeof(); temp_index++)
00378                {
00379                   uGet4Enabled[temp_index] = ((TString)line(0,3)).Atoi();
00380                   line = line(3, 3*MAX_GET4);
00381                } // for(UInt_t temp_index = 0; temp_index < MAX_GET4 && 0 != line.Sizeof(); temp_index++)
00382             } // if( 0 != line.Sizeof() )
00383          }
00384          else if(line.Contains("indreftdc")==kTRUE)
00385          {
00386             iReferenceTdc = ((TString)line(10,10)).Atoi();
00387          }
00388          else if(line.Contains("charefone")==kTRUE)
00389          {
00390             iReferenceChannel1 = ((TString)line(10,10)).Atoi();
00391          }
00392          else if(line.Contains("chareftwo")==kTRUE)
00393          {
00394             iReferenceChannel2 = ((TString)line(10,10)).Atoi();
00395          }
00396          else if(line.Contains("caenintree")==kTRUE)
00397          {
00398             uCaenInTree = ((TString)line(11,10)).Atoi();
00399          }
00400          else if(line.Contains("caenmode")==kTRUE)
00401          {
00402             uCaenMode = ((TString)line(10,10)).Atoi();
00403          }
00404          else if(line.Contains("caenmulti")==kTRUE)
00405          {
00406             uCaenMulti = ((TString)line(10,10)).Atoi();
00407          }
00408          else if(line.Contains("caentdcena")==kTRUE)
00409          {
00410             line = line(11,39);
00411             if( 0 != line.Sizeof() )
00412             {
00413                for(UInt_t temp_index = 0; temp_index < MAX_1290 && 0 != line.Sizeof(); temp_index++)
00414                {
00415                   uGeneralCaenTdcEnabled[temp_index] = ((TString)line(0,3)).Atoi();
00416                   line = line(3,39);
00417                } // for(UInt_t temp_index = 0; temp_index < MAX_1290 && 0 != line.Sizeof(); temp_index++)
00418             } // if( 0 != line.Sizeof() )
00419          }
00420          else if(line.Contains("pmttdcind")==kTRUE)
00421          {
00422             iPmtTdc = ((TString)line(10,10)).Atoi();
00423          }
00424          else if(line.Contains("pmtqdcind")==kTRUE)
00425          {
00426             iPmtQdc = ((TString)line(10,10)).Atoi();
00427          }
00428          else if(line.Contains("rpctdclei")==kTRUE)
00429          {
00430             iRpcTdcLeading = ((TString)line(10,10)).Atoi();
00431          }
00432          else if(line.Contains("rpctdcfai")==kTRUE)
00433          {
00434             iRpcTdcTrailing = ((TString)line(10,10)).Atoi();
00435          }
00436          else if(line.Contains("trigintree")==kTRUE)
00437          {
00438             uTriglogInputInTree = ((TString)line(11,10)).Atoi();
00439          }
00440          else if(line.Contains("hodointree")==kTRUE)
00441          {
00442             uHodoInputInTree = ((TString)line(11,10)).Atoi();
00443          }
00444          else if(line.Contains("hodohisdeb")==kTRUE)
00445          {
00446             uHodoDebugHisto = ((TString)line(11,10)).Atoi();
00447          }
00448          else if(line.Contains("vftxintree")==kTRUE)
00449          {
00450             uVftxInTree = ((TString)line(11,10)).Atoi();
00451          }
00452          else if(line.Contains("vftxfullbo")==kTRUE)
00453          {
00454             uVftxFullBoardData = ((TString)line(11,10)).Atoi();
00455          }
00456          else if(line.Contains("vftxfullda")==kTRUE)
00457          {
00458             uVftxFullDataMode = ((TString)line(11,10)).Atoi();
00459          }
00460          else if(line.Contains("vftxenable")==kTRUE)
00461          {
00462             line = line(11,39);
00463             if( 0 != line.Sizeof() )
00464             {
00465                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00466                {
00467                   uVftxEnabled[temp_index] = ((TString)line(0,3)).Atoi();
00468                   line = line(3,39);
00469                } // for(UInt_t temp_index = 0; temp_index < MAX_1290 && 0 != line.Sizeof(); temp_index++)
00470             } // if( 0 != line.Sizeof() )
00471          }
00472          else if(line.Contains("rpcintree")==kTRUE)
00473          {
00474             uRpcInTree = ((TString)line(11,10)).Atoi();
00475          }
00476          else if(line.Contains("rpcenable")==kTRUE)
00477          {
00478             line = line(11,39);
00479             if( 0 != line.Sizeof() )
00480             {
00481                for(UInt_t temp_index = 0; temp_index < NB_RPC && 0 != line.Sizeof(); temp_index++)
00482                {
00483                   uRpcEnabled[temp_index] = ((TString)line(0,3)).Atoi();
00484                   line = line(3,39);
00485                } // for(UInt_t temp_index = 0; temp_index < MAX_1290 && 0 != line.Sizeof(); temp_index++)
00486             } // if( 0 != line.Sizeof() )
00487          }
00488          else if(line.Contains("plasintree")==kTRUE)
00489          {
00490             uPlasticsInTree = ((TString)line(11,10)).Atoi();
00491          }
00492          else if(line.Contains("plasenable")==kTRUE)
00493          {
00494             line = line(11,39);
00495             if( 0 != line.Sizeof() )
00496             {
00497                for(UInt_t temp_index = 0; temp_index < NB_PLASTICS && 0 != line.Sizeof(); temp_index++)
00498                {
00499                   uPlasticsEnabled[temp_index] = ((TString)line(0,3)).Atoi();
00500                   line = line(3,39);
00501                } // for(UInt_t temp_index = 0; temp_index < MAX_1290 && 0 != line.Sizeof(); temp_index++)
00502             } // if( 0 != line.Sizeof() )
00503          }
00504          else if(line.Contains("prpcintree")==kTRUE)
00505          {
00506             uPadRpcInTree = ((TString)line(11,10)).Atoi();
00507          }
00508          else if(line.Contains("scomintree")==kTRUE)
00509          {
00510             uScalOrMuInTree = ((TString)line(11,10)).Atoi();
00511          }
00512          else if(line.Contains("matcintree")==kTRUE)
00513          {
00514             uMatchingInTree = ((TString)line(11,10)).Atoi();
00515          }
00516          else if(line.Contains("slcointree")==kTRUE)
00517          {
00518             uSlowControlInTree = ((TString)line(11,10)).Atoi();
00519          }
00520          else if(line.Contains("nbslowcoch")==kTRUE)
00521          {
00522             uNbSlowControlChan = ((TString)line(11,10)).Atoi();
00523             if( MAX_HV_CHAN_SC < uNbSlowControlChan)
00524                uNbSlowControlChan = MAX_HV_CHAN_SC;
00525          }
00526          else if(line.Contains("slowcontch")==kTRUE)
00527          {
00528             line = line(12,36);
00529             if( 0 != uNbSlowControlChan && 0 != line.Sizeof() )
00530             {
00531                UInt_t uChannelIndex = 0;
00532                for(UInt_t temp_index = 0; temp_index < uNbSlowControlChan && 0 != line.Sizeof(); temp_index++)
00533                {
00534                   uChannelIndex = ((TString)line(0,3)).Atoi();
00535 
00536                   uSlowControlChans[temp_index]= uChannelIndex;
00537                   sScInputNamePosI[temp_index] = Form("CBM:HV:A1526P:CH%d:imon", uChannelIndex);
00538                   sScOutputNamePosI[temp_index]= Form("I_PosHv_ch%d", uChannelIndex);
00539                   sScInputNamePosU[temp_index] = Form("CBM:HV:A1526P:CH%d:vmon", uChannelIndex);
00540                   sScOutputNamePosU[temp_index]= Form("U_PosHv_ch%d", uChannelIndex);
00541                   sScInputNameNegI[temp_index] = Form("CBM:HV:A1526N:CH%d:imon", uChannelIndex);
00542                   sScOutputNameNegI[temp_index]= Form("I_NegHv_ch%d", uChannelIndex);
00543                   sScInputNameNegU[temp_index] = Form("CBM:HV:A1526N:CH%d:vmon", uChannelIndex);
00544                   sScOutputNameNegU[temp_index]= Form("U_NegHv_ch%d", uChannelIndex);
00545 
00546                   line = line(3,36);
00547                } // for(UInt_t temp_index = 0; temp_index < uNbStrips && 0 != line.Sizeof(); temp_index++)
00548             } //  if( 0 != uNbSlowControlChan && 0 != line.Sizeof() )
00549             else if( 0 == line.Sizeof() )
00550                cout<<"Error: Some HV channel expected and empty string for exact indexes!"<<endl;
00551          } // else if(line.Contains("slowcontch")==kTRUE)
00552          
00553       }
00554    }
00555    
00556    setupFile.close();
00557    
00558    return kTRUE;
00559 }
00560 Int_t TRootConverterParam::PrintOptions()
00561 {
00562    cout<<"******************* ROOT Tree converter parameters *********************"<<endl;
00563 //   cout<<"       Option values Root Converter Param"<<endl;
00564    if( uRootDisplay )
00565       cout<<"Clean data tree display in Go4:    ON "<<endl;
00566       else cout<<"Clean data tree display in Go4:    OFF"<<endl;
00567    if( uCleanOuputEnable )
00568    {
00569       cout<<"Output file for clean data tree:   ON "<<endl;
00570       cout<<"Output filename:                   "<<sOutputFilename<<endl;
00571    }
00572       else cout<<"Output file for clean data tree:   OFF"<<endl;
00573    if( uRootDisplay && 0 == uCleanOuputEnable )
00574       cout<<"Nb Events before periodic reset:   "<<uEventsUntilReset<<endl;
00575    if(1 == uRootDisplay || 1 == uCleanOuputEnable )
00576    {
00577       if( 1 == uGet4InTree )
00578       {
00579          cout<<"GET4 data added to the TTree:      ON "<<endl;
00580          if( 1 == uMultiEventsAllowed)
00581             cout<<"GET4 multiple evts per MBS evt:    ALL SAVED"<<endl;
00582             else
00583             {
00584                cout<<"GET4 multiple evts per MBS evt:    Only 1st SAVED"<<endl;
00585                cout<<"GET4 tdc index:            |-      ";
00586                for( Int_t iIndexGet4 = 0; iIndexGet4 < MAX_GET4; iIndexGet4++)
00587                {
00588                   cout.width(2);
00589                   cout<<iIndexGet4<<" ";
00590                }
00591                cout<<endl<<"Added in Tree?             |->     ";
00592                for( Int_t iIndexGet4 = 0; iIndexGet4 < MAX_GET4; iIndexGet4++)
00593                {
00594                   cout.width(2);
00595                   cout<<uGet4Enabled[iIndexGet4]<<" ";
00596                }
00597                cout<<endl;
00598             }
00599       }
00600          else cout<<"GET4 data added to the TTree:       OFF"<<endl;
00601       if( -1 != iPmtTdc || -1 != iPmtQdc )
00602       {
00603          cout<<"Caen TDC for PMT data:             "<<iPmtTdc<<endl;
00604          cout<<"Lecroy for PMT data:               "<<iPmtQdc<<endl;
00605       }
00606       if( uCaenInTree )
00607       {
00608          if( 0 == uCaenMode)
00609          {
00610             cout<<"mode for CAEN data in tree:        COSY 2011 like "<<endl;
00611             if( -1 != iRpcTdcLeading || -1 != iRpcTdcTrailing )
00612             {
00613                cout<<"Caen TDC for RPC leading edge:    "<<iRpcTdcLeading<<endl;
00614                cout<<"Caen TDC for RPC trailing edge:   "<<iRpcTdcTrailing<<endl;
00615             }
00616             if( -1 != iReferenceTdc || -1 != iReferenceChannel1 || -1 != iReferenceChannel2)
00617             {
00618                cout<<"Caen TDC for t0 reference:        "<<iReferenceTdc<<endl;
00619                cout<<"1st Caen TDC Channel for t0 ref:  "<<iReferenceChannel1<<endl;
00620                cout<<"2nd Caen TDC Channel for t0 ref:  "<<iReferenceChannel2<<endl;
00621             }
00622          } // if( 0 == uCaenMode)
00623          else
00624          {
00625             cout<<"mode for CAEN data in tree:        General "<<endl;
00626             if( 1 == uCaenMulti )
00627                cout<<"CAEN multiple hits in TTree:       ON "<<endl;
00628                else cout<<"CAEN multiple hits in TTree:       OFF"<<endl;
00629 
00630             cout<<"Caen v1290 tdc index:      |-      ";
00631             for( Int_t iIndex1290 = 0; iIndex1290 < MAX_1290; iIndex1290++)
00632             {
00633                cout.width(2);
00634                cout<<iIndex1290<<" ";
00635             }
00636             cout<<endl<<"Added in Tree?             |->     ";
00637             for( Int_t iIndex1290 = 0; iIndex1290 < MAX_1290; iIndex1290++)
00638             {
00639                cout.width(2);
00640                cout<<uGeneralCaenTdcEnabled[iIndex1290]<<" ";
00641             }
00642             cout<<endl;
00643          } // else of if( 0 == uCaenMode) => general mode
00644       } // if( uCaenInTree )
00645          else cout<<"CAEN data added to the TTree:      OFF"<<endl;
00646       if( uTriglogInputInTree )
00647          cout<<"TrigLog data added to the TTree:   ON "<<endl;
00648          else cout<<"TrigLog data added to the TTree:   OFF"<<endl;
00649       if( uHodoInputInTree )
00650          cout<<"Hodoscope data added to the TTree: ON "<<endl;
00651          else cout<<"Hodoscope data added to the TTree: OFF"<<endl;
00652       if( uHodoDebugHisto )
00653          cout<<"Hodoscope debug histograms:        ON "<<endl;
00654          else cout<<"Hodoscope debug histograms:        OFF"<<endl;
00655       if( uVftxInTree )
00656       {
00657          cout<<"VFTX data added to the TTree:      ON "<<endl;
00658 
00659          if( uVftxFullDataMode )
00660          cout<<"VFTX data in tree:                 FULL = raw + calib "<<endl;
00661             else cout<<"VFTX data in tree:                 Only CALIB "<<endl;
00662 
00663          cout<<"VFTX tdc index:            |-      ";
00664          for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00665          {
00666             cout.width(2);
00667             cout<<iIndexVftx<<" ";
00668          }
00669          cout<<endl<<"Added in Tree?             |->     ";
00670          for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00671          {
00672             cout.width(2);
00673             cout<<uVftxEnabled[iIndexVftx]<<" ";
00674          }
00675          cout<<endl;
00676       }
00677          else cout<<"VFTX data added to the TTree:      OFF"<<endl;
00678 
00679       if( uRpcInTree )
00680       {
00681          cout<<"Rpc full event added to TTree:     ON "<<endl;
00682          cout<<"Rpc index:                 |-      ";
00683          for( UInt_t uRpcIndex = 0; uRpcIndex < NB_RPC; uRpcIndex++ )
00684          {
00685             cout.width(2);
00686             cout<<uRpcIndex<<" ";
00687          }
00688          cout<<endl<<"Added in Tree?             |->     ";
00689          for( UInt_t uRpcIndex = 0; uRpcIndex < NB_RPC; uRpcIndex++ )
00690          {
00691             cout.width(2);
00692             cout<<uRpcEnabled[uRpcIndex]<<" ";
00693          }
00694          cout<<endl;
00695       }
00696          else cout<<"Rpc full event added to TTree:     OFF"<<endl;
00697 
00698       if( uPlasticsInTree )
00699       {
00700          cout<<"Plastics full event added to TTree:ON "<<endl;
00701          cout<<"Plastic index:             |-      ";
00702          for( UInt_t uPlasticIndex = 0; uPlasticIndex < NB_PLASTICS; uPlasticIndex++ )
00703          {
00704             cout.width(2);
00705             cout<<uPlasticIndex<<" ";
00706          }
00707          cout<<endl<<"Added in Tree?             |->     ";
00708          for( UInt_t uPlasticIndex = 0; uPlasticIndex < NB_PLASTICS; uPlasticIndex++ )
00709          {
00710             cout.width(2);
00711             cout<<uPlasticsEnabled[uPlasticIndex]<<" ";
00712          }
00713          cout<<endl;
00714       }
00715          else cout<<"Plastics full event added to TTree:OFF"<<endl;
00716       if( uPadRpcInTree )
00717          cout<<"PAD RPC full event added to TTree: ON "<<endl;
00718          else cout<<"PAD RPC full event added to TTree: OFF"<<endl;
00719       if( uScalOrMuInTree )
00720          cout<<"ScalOrMu scalers added to TTree:   ON "<<endl;
00721          else cout<<"ScalOrMu scalers added to TTree:   OFF"<<endl;
00722       if( uMatchingInTree )
00723          cout<<"Matching full event added to TTree:ON "<<endl;
00724          else cout<<"Matching full event added to TTree:OFF"<<endl;
00725 
00726       if( uSlowControlInTree )
00727       {
00728          cout<<"HDRPC HV value added to the TTree: ON "<<endl;
00729          cout<<"Nb slow control HV channels saved:  "<<uNbSlowControlChan<<endl;
00730          cout<<"Index slow control HV channels:     ";
00731          for(UInt_t temp_index = 0; temp_index < uNbSlowControlChan; temp_index++)
00732             cout<<uSlowControlChans[temp_index]<<" ";
00733          cout<<endl;
00734 //         for(UInt_t temp_index = 0; temp_index < uNbSlowControlChan; temp_index++)
00735 //         {
00736 //            cout<<sScInputNamePosI[temp_index]<<" ";
00737 //            cout<<sScOutputNamePosI[temp_index]<<" ";
00738 //            cout<<sScInputNamePosU[temp_index]<<" ";
00739 //            cout<<sScOutputNamePosU[temp_index]<<" ";
00740 //            cout<<sScInputNameNegI[temp_index]<<" ";
00741 //            cout<<sScOutputNameNegI[temp_index]<<" ";
00742 //            cout<<sScInputNameNegU[temp_index]<<" ";
00743 //            cout<<sScOutputNameNegU[temp_index]<<" ";
00744 //            cout<<endl;
00745 //         }
00746       }
00747          else cout<<"HDRPC HV value added to the TTree: OFF"<<endl;
00748    }
00749    cout<<"************************************************************************"<<endl;
00750    
00751    return 0;
00752 }

Generated on Tue Dec 10 2013 04:52:18 for ROCsoft by  doxygen 1.7.1