INDICATION The latest string here to be written is in developement status. all others above should work....
THE PARASETS STILL NEED CONFIRMATION if THE NUMBERS_ for labelling are correctly filled!!!
1979{
1980
1981
1982
1983 char buf[256];
1984 char key[256];
1986
1987 FILE *fp = fopen(
file,
"r");
1988 if (!fp) {
1989 Log(1,
"EdbShowRec::ReadShowRecPar",
"ERROR open file: %s",
file);
1990 return -1;
1991 }
1992 else Log(2,
"EdbShowRec::ReadShowRecPar",
"Read shower parameters from file: %s",
file );
1993
1995 Int_t int_eUse;
1996 int dospec;
1997 TString tmpString;
1998 char tmpchar[256];
1999
2000 while (fgets(buf, sizeof(buf), fp)) {
2001 for (Int_t i = 0; i < (Int_t)strlen(buf); ++i)
2002 if (buf[i]=='#') {
2003 buf[i]='\0';
2004 break;
2005 }
2006
2007 if ( sscanf(buf,"%s",key)!=1 ) continue;
2008
2009 if ( !strcmp(key,"INCLUDE") )
2010 {
2011 sscanf(buf+strlen(key),
"%s",
name);
2013 }
2014
2015
2018 else if ( !strcmp(key,"SHOW_DO_RECONSTRUCTION") )
2019 {
2020 sscanf(buf+strlen(key),"%d",&dospec);
2021 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_RECONSTRUCTION = " << dospec << endl;
2023 }
2024 else if ( !strcmp(key,"SHOW_DO_PARAMETRISATION") )
2025 {
2026 sscanf(buf+strlen(key),"%d",&dospec);
2027 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_PARAMETRISATION = " << dospec << endl;
2029 }
2030 else if ( !strcmp(key,"SHOW_DO_ID") )
2031 {
2032 sscanf(buf+strlen(key),"%d",&dospec);
2033 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_ID = " << dospec << endl;
2034 if (dospec==0 || dospec==1)
SetDoId(dospec);
2035 }
2036 else if ( !strcmp(key,"SHOW_DO_ENERGY") )
2037 {
2038 sscanf(buf+strlen(key),"%d",&dospec);
2039 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_ENERGY = " << dospec << endl;
2041 }
2042 else if ( !strcmp(key,"SHOW_DO_VERTEXATTACH") )
2043 {
2044 sscanf(buf+strlen(key),"%d",&dospec);
2045 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_VERTEXATTACH = " << dospec << endl;
2047 }
2048
2050
2052 else if ( !strcmp(key,"SHOW_USE_LT") )
2053 {
2054 sscanf(buf+strlen(key),"%d",&int_eUse);
2056 if (int_eUse==1) {
2063 }
2064 else {
2066 }
2067 cout <<
"eUse_LT now " <<
eUse_LT << endl;
2068 }
2069
2070 else if ( !strcmp(key,"SHOW_USE_ALIBT") )
2071 {
2072 sscanf(buf+strlen(key),"%d",&int_eUse);
2074 if (int_eUse==1) {
2081 }
2082 else {
2084 }
2085 cout <<
"eUse_AliBT now " <<
eUse_AliBT << endl;
2086 }
2087
2088
2089 else if ( !strcmp(key,"SHOW_USE_ROOTInBT") )
2090 {
2091 sscanf(buf+strlen(key),"%d",&int_eUse);
2093 if (int_eUse==1) {
2100 }
2101 else {
2103 }
2104 cout <<
"eUse_AliLT now " <<
eUse_AliLT << endl;
2105 }
2106
2107
2108 else if ( !strcmp(key,"SHOW_USE_PVREC") )
2109 {
2110 sscanf(buf+strlen(key),"%d",&int_eUse);
2112 if (int_eUse==1) {
2119 }
2120 else {
2122 }
2123 cout <<
"eUse_PVREC now " <<
eUse_PVREC << endl;
2124 }
2125
2126 else if ( !strcmp(key,"SHOW_INBTCUT") )
2127 {
2128 char rcut[256];
2129 sscanf(buf+strlen(key),"%d %s",&id, rcut );
2130 cout << "SHOW_INBTCUT = " << rcut << endl;
2133 }
2134
2135
2137 else if ( !strcmp(key,"SHOW_WRITE_TREEBRANCH") )
2138 {
2139 sscanf(buf+strlen(key),"%d",&dospec);
2140 Bool_t dospec_bool=(Bool_t)dospec;
2141 cout << "EdbShowRec::ReadShowRecPar SHOW_WRITE_TREEBRANCH = " << dospec_bool << endl;
2143 }
2144 else if ( !strcmp(key,"SHOW_WRITE_SHOWERS") )
2145 {
2146 sscanf(buf+strlen(key),"%d",&dospec);
2147 Bool_t dospec_bool=(Bool_t)dospec;
2148 cout << "EdbShowRec::ReadShowRecPar SHOW_WRITE_SHOWERS = " << dospec_bool << endl;
2150 }
2151
2152 else if ( !strcmp(key,"SHOW_FILE_TREEBRANCH") )
2153 {
2154 sscanf(buf+strlen(key),"%s",tmpchar);
2155 tmpString=TString(tmpchar);
2157 cout << "SHOW_FILE_TREEBRANCH = " << tmpString << endl;
2158 }
2159
2160 else if ( !strcmp(key,"SHOW_FILE_SHOWERS") )
2161 {
2162 sscanf(buf+strlen(key),"%s",tmpchar);
2163 tmpString=TString(tmpchar);
2165 cout << "SHOW_FILE_SHOWERS = " << tmpString << endl;
2166 }
2167
2168 else if ( !strcmp(key,"SHOW_USE_SIMPLEFILENAME") )
2169 {
2170 Int_t filetype, dofiletype;
2171 sscanf(buf+strlen(key),"%d %d",&filetype, &dofiletype);
2172 cout << "EdbShowRec::ReadShowRecPar filetype = " << filetype << endl;
2173 cout << "EdbShowRec::ReadShowRecPar dofiletype = " << dofiletype << endl;
2175 }
2176
2177 else if ( !strcmp(key,"SHOW_FIRSTPLATE") )
2178 {
2179 int ProposedFirstPlate;
2180 sscanf(buf+strlen(key),"%d",&ProposedFirstPlate);
2181 cout << "EdbShowRec::ReadShowRecPar ProposedFirstPlate = " << ProposedFirstPlate << endl;
2183 }
2184 else if ( !strcmp(key,"SHOW_LASTPLATE") )
2185 {
2186 int ProposedLastPlate;
2187 sscanf(buf+strlen(key),"%d",&ProposedLastPlate);
2188 cout << "EdbShowRec::ReadShowRecPar ProposedLastPlate = " << ProposedLastPlate << endl;
2190 }
2191 else if ( !strcmp(key,"SHOW_MIDDLEPLATE") )
2192 {
2193 int ProposedMiddlePlate;
2194 sscanf(buf+strlen(key),"%d",&ProposedMiddlePlate);
2195 cout << "EdbShowRec::ReadShowRecPar ProposedMiddlePlate = " << ProposedMiddlePlate << endl;
2197 }
2198 else if ( !strcmp(key,"SHOW_NUMBERPLATE") )
2199 {
2200 int ProposedNumberPlate;
2201 sscanf(buf+strlen(key),"%d",&ProposedNumberPlate);
2202 cout << "EdbShowRec::ReadShowRecPar ProposedNumberPlate = " << ProposedNumberPlate << endl;
2204 }
2205
2208
2210
2212 else if ( !strcmp(key,"SHOW_ADDPARASET") )
2213 {
2214 float par[10];
2215 for (Int_t i=0; i<10; ++i) {
2216 par[i]=-9999.0;
2217 }
2219 int n=sscanf(buf+strlen(key),
"%d %f %f %f %f %f",&
type, &par[0], &par[1], &par[2], &par[3], &par[4] );
2220 cout << "n= " << n << endl;
2221 if (n==5) {
2223 }
2224 else {
2225 cout << "EdbShowRec::ReadShowRecPar WRONG FORMAT of SHOW_ADDPARASET. 4 Parameters at least!" << endl;
2226 }
2227 }
2228
2229
2230 else if ( !strcmp(key,"SHOW_SETPARASET") )
2231 {
2232 float par[10];
2233 for (Int_t i=0; i<10; ++i) {
2234 par[i]=-9999.0;
2235 }
2237 int n=sscanf(buf+strlen(key),
"%d %f %f %f %f %f",&
type, &par[0], &par[1], &par[2], &par[3], &par[4] );
2238 cout << "n= " << n << endl;
2239 if (n==5) {
2242 }
2243 else {
2244 cout << "EdbShowRec::ReadShowRecPar WRONG FORMAT of SHOW_ADDPARASET. Need 4 Parameters at least!" << endl;
2245 }
2246 }
2247
2248 else if ( !strcmp(key,"SHOW_DO_PARA") )
2249 {
2250 sscanf(buf+strlen(key),"%d",&dospec);
2251 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_PARA = " << dospec << endl;
2253 }
2254
2255 else if ( !strcmp(key,"SHOW_DO_PARA_NAME") )
2256 {
2257 sscanf(buf+strlen(key),"%s",tmpchar);
2258 tmpString=TString(tmpchar);
2259 cout << "EdbShowRec::ReadShowRecPar SHOW_DO_PARA_NAME = " << tmpString << endl;
2261 }
2262
2263 else if ( !strcmp(key,"SHOW_ALG_USE_ALISUB") )
2264 {
2265 sscanf(buf+strlen(key),"%d",&dospec);
2266 cout << "EdbShowRec::ReadShowRecPar SHOW_ALG_USE_ALISUB = " << dospec << endl;
2268 }
2269
2270
2271 }
2273
2274
2277
2278
2281
2282
2283 Log(2,
"EdbShowRec::ReadShowRecPar",
"Read shower parameters...done.");
2284 return 0;
2285}
int ReadShowRecPar(const char *file)
Definition: EdbShowRec.cxx:1978
void SetSimpleFileName(Int_t type, Int_t dotype)
Definition: EdbShowRec.cxx:3859
void SetTreebranchFileName(TString Filename_Out_treebranch)
Definition: EdbShowRec.h:432
void SetUseAliSub(Int_t type)
Definition: EdbShowRec.cxx:3916
void Print_UseInBTType()
Definition: EdbShowRec.cxx:2305
void Add_INBTCut(Int_t layer, TCut &cut)
Definition: EdbShowRec.cxx:2323
void SetWriteFileShower(Int_t WriteFileShower)
Definition: EdbShowRec.h:419
void Print_InBTCut(Int_t layer)
Definition: EdbShowRec.cxx:2338
void SetDoParaType(Int_t type)
Definition: EdbShowRec.cxx:3877
void ResetUse_InBTType()
Definition: EdbShowRec.cxx:2289
void SetDoParametrisation(Int_t dospec)
Definition: EdbShowRec.h:321
void SetDoId(Int_t dospec)
Definition: EdbShowRec.h:324
void SetDoReconstruction(Int_t dospec)
Definition: EdbShowRec.h:318
void SetShowFileName(TString Filename_Out_shower)
Definition: EdbShowRec.h:426
void SetWriteFileTreebranch(Int_t WriteFileTreebranch)
Definition: EdbShowRec.h:429
void AddAlg(Int_t AlgType, Float_t *par)
Definition: EdbShowRec.cxx:3556
void ResetShowAlgArray()
Definition: EdbShowRec.cxx:3646
void SetDoEnergy(Int_t dospec)
Definition: EdbShowRec.h:327
void SetDoVtxAttach(Int_t dospec)
Definition: EdbShowRec.h:330
const char * name
Definition: merge_Energy_SytematicSources_Electron.C:24
UInt_t id
Definition: tlg2couples.C:117