StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
haddWanaSL11b.C
1 //$Id: haddWanaSL11b.C,v 1.1 2011/09/14 15:43:27 stevens4 Exp $
2 // line added after tag=DNP2009 by Jan
3 // run list chaned to match final run selection for SL09g
4 
5 #include <string.h>
6 #include "TChain.h"
7 #include "TFile.h"
8 #include "TH1.h"
9 #include "TTree.h"
10 #include "TKey.h"
11 #include "Riostream.h"
12 
13 TList *FileList;
14 TFile *Target;
15 
16 
17 int isAPS2010pol=0; /* affects only setP1-P4, not setA-D,
18  set it to 0 to see all usable polarized fills */
19 
20 
21 
22 void MergeRootfile( TDirectory *target, TList *sourcelist );
23 
24 void haddWanaSL11bX() {
25  //haddWana("jamie_1");
26  //haddWana("jamie_2");
27  //haddWana("jamie_all");
28  //haddWana("run9setB_highHV");
29  //haddWana("run9setB_lowHV");
30 
31  //haddWana("higherTpcHV");
32  //haddWana("lowerTpcHV");
33 
34  //haddWana("zdcRateLow1");
35  //haddWana("zdcRateLow2");
36  //haddWana("zdcRateLow");
37  //haddWana("zdcRateHigh");
38 
39  haddWana("zdcRateA");
40  haddWana("zdcRateB");
41  haddWana("zdcRateC");
42 }
43 
44 void haddWanaSL11bY() {
45  haddWana("production2009_500Gev_c_1");
46  haddWana("production2009_500Gev_c_2");
47  haddWana("production2009_500Gev_c_all");
48 }
49 
50 void haddWanaSL11b() {
51  haddWana("run9setA");
52  haddWana("run9setB");
53  haddWana("run9setC");
54  haddWana("run9setD");
55  haddWana("run9setABCD");
56 }
57 
58 void haddWana(char *set,TString iPath="/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/data/") {
59  // iPath="/star/institutions/mit/balewski/freezer/2009-Wana-SL09g-may3-PRL/data/";
60  TString out=iPath;
61 
62  if(strstr("F10505",set)>0) {
63  char *runL=" R10096141 R10097003 R10097004 R10097005 R10097008";
64  } else if(strstr("run9setA",set)>0) {
65  char *runL="R10076134 R10076136 R10076152 R10076153 R10076154 R10076161 R10078077 R10078078 R10078081 R10078082 R10078092 R10078093 R10078094 R10079002 R10079004 R10079005 R10079006 R10079007 R10079015 R10079016 R10079017 R10079027 R10079028 R10079030 R10079031 R10079033 R10079034 R10079035 R10079040 R10079042 R10079045 R10079046 R10079047 R10079049 R10079050 R10079057 R10079059 R10079060 R10079061 R10079062 R10079063 R10079069 R10079070 R10079071 R10079074 R10079078 R10079079 R10079080 R10079081 R10079129 R10079130 R10079131 R10079135 R10079137 R10079138 R10079139 R10080019 R10080020 R10080022 R10080040 R10080042 R10080061 R10080062 R10080076 R10080077 R10080078 R10080080 R10080081 R10081007 R10081013 R10081026 R10081027 R10081047 R10081053 R10081055 R10081056 R10081096 R10081102 R10081104 R10081107 R10081108 R10081110 R10081111 R10081112 R10081115 R10081117 R10082003 R10082005 R10082008 R10082011 R10082018 R10082021 R10082022 R10082027 R10082029 R10082031 R10082032 R10082035 R10082043 R10082071 R10082072 R10082073 R10082074 R10082075 R10082076 R10082077 R10082078 R10082083 R10082085 R10082091 R10082092 R10082093 R10082095 R10083013 R10083018 R10083019 R10083026 R10083027 R10083028 R10083032 R10083033 R10083034 R10083037 R10083040 R10083041 R10083045 R10083047 R10083052 R10083053 R10083054 R10083055 R10083056 R10083058 R10084010 R10084011 R10084021 R10084022 R10084024 R10085016 R10085017 R10085018 R10085019 R10085023 R10085024 R10085025 R10085026 R10085027 R10085028 R10085029 R10085030 R10085031 R10085032 R10085038 R10085039 R10085104 R10085107 R10085108 R10085109 R10085113 R10085114 R10085115 R10085131 R10085132 R10085133 R10085134 R10085135 R10085136 R10085140 R10086001 R10086007 R10086008 R10086015 R10086022 R10086023 R10086024 R10086037 R10086043 R10086044 R10086046"; //total for setA 179
66  } else if(strstr("run9setB",set)>0) {
67  char *runL="R10087001 R10087009 R10087011 R10087012 R10087018 R10087020 R10087021 R10087022 R10087023 R10087025 R10087028 R10087031 R10087032 R10087033 R10087034 R10087035 R10087036 R10087037 R10087041 R10087051 R10087052 R10087053 R10087054 R10087057 R10087058 R10087059 R10087062 R10087063 R10087065 R10087067 R10087069 R10087070 R10087071 R10087077 R10087078 R10087082 R10087084 R10087085 R10087088 R10087094 R10087096 R10087097 R10087114 R10087117 R10087119 R10087125 R10087126 R10088001 R10088010 R10088011 R10088013 R10088022 R10088024 R10088026 R10088027 R10088028 R10088029 R10088030 R10088031 R10088036 R10088058 R10088062 R10088063 R10088069 R10088070 R10088071 R10088075 R10088077 R10088081 R10088084 R10088085 R10088096 R10088102 R10088110 R10088111 R10088112 R10088113 R10088120 R10088121 R10089001 R10089004 R10089008 R10089010 R10089011 R10089015 R10089016 R10089019 R10089021 R10089023 R10089079 R10089080 R10089081 R10090001 R10090004 R10090005 R10090008 R10090013 R10090015 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10090037 R10090038 R10090040 R10090042 R10090046 R10090047 R10090072 R10090074 R10090076 R10090079 R10090080 R10090081 R10090089 R10090095 R10090100 R10090108 R10090109 R10090111 R10090112 R10091089 R10091090 R10092002 R10092004 R10092009 R10092011 R10092021 R10092022 R10092023 R10092024 R10092027 R10092028 R10092029 R10092030 R10092031 R10092033 R10092034 R10092036 R10092037 R10092038 R10092039 R10092040 R10092042 R10092046 R10092047 R10092048 R10092049 R10092050 R10092084 R10092098 R10092102 R10092105 R10092107 R10093082 R10093083 R10093084 R10093131 R10094003 R10094005 R10094006 R10094007 R10094016 R10094019 R10094021 R10094022 R10094023 R10094024 R10094063 R10094067 R10094071 R10094073 R10094078 R10094084 R10094088 R10094089 R10094090 R10094092 R10094095 R10094096 R10094098 R10094099 R10094100 R10095022 R10095023 R10095024 R10095030 R10095036 R10095037 R10095039 R10095040 R10095041 R10095045 R10095046 R10095047 R10095048 R10095049 R10095050 R10095051 R10095052 R10095056 R10095057 R10095120 R10095121 R10095122 R10095125 R10096001 R10096002 R10096005 R10096006 R10096007 R10096008 R10096009 R10096014 R10096015 R10096019 R10096024 R10096025 R10096026 R10096027"; //total for setB: 223
68  } else if(strstr("run9setB_highHV",set)>0) {
69  char *runL="R10087001 R10087009 R10087011 R10087012 R10087018 R10087020 R10087021 R10087022 R10087023 R10087025 R10087028 R10087031 R10087032 R10087033 R10087034 R10087035 R10087036 R10087037 R10087041 R10087051 R10087052 R10087053 R10087054 R10087057 R10087058 R10087059 R10087062 R10087063 R10087065 R10087067 R10087069 R10087070 R10087071 R10087077 R10087078 R10087082 R10087084 R10087085 R10087088 R10087094 R10087096 R10087097 R10087114 R10087117 R10087119 R10087125 R10087126 R10088001 R10088010 R10088011 R10088013 R10088022 R10088024 R10088026 R10088027 R10088028 R10088029 R10088030 R10088031 R10088036 R10088058 R10088062 R10088063 R10088069 R10088070 R10088071 R10088075 R10088077 R10088081 R10088084 R10088085 R10088096 R10088102 R10088110 R10088111 R10088112 R10088113 R10088120 R10088121 R10089001 R10089004 R10089008 R10089010 R10089011 R10089015 R10089016 R10089019 R10089021 R10089023 R10089079 R10089080 R10089081 R10090001 R10090004 R10090005 R10090008 R10090013 R10090015 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10090037 R10090038 R10090040 R10090042 R10090046 R10090047 R10090072 R10090074 R10090076 R10090079 R10090080 R10090081 R10090089 R10090095 R10090100 R10090108 R10090109 R10090111 R10090112 R10091089 R10091090 R10092002 R10092004 R10092009 R10092011 R10092021 R10092022 R10092023 R10092024 R10092027 R10092028 R10092029 R10092030 R10092031 R10092033 R10092034 R10092036 R10092037 R10092038 R10092039 R10092040 R10092042 R10092046 R10092047 R10092048 R10092049 R10092050 R10092084 R10092098 R10092102 R10092105 R10092107 R10093082 R10093083 R10093084 R10093131";
70  } else if(strstr("run9setB_lowHV",set)>0) {
71  char *runL=" R10094003 R10094005 R10094006 R10094007 R10094016 R10094019 R10094021 R10094022 R10094023 R10094024 R10094063 R10094067 R10094071 R10094073 R10094078 R10094084 R10094088 R10094089 R10094090 R10094092 R10094095 R10094096 R10094098 R10094099 R10094100 R10095022 R10095023 R10095024 R10095030 R10095036 R10095037 R10095039 R10095040 R10095041 R10095045 R10095046 R10095047 R10095048 R10095049 R10095050 R10095051 R10095052 R10095056 R10095057 R10095120 R10095121 R10095122 R10095125 R10096001 R10096002 R10096005 R10096006 R10096007 R10096008 R10096009 R10096014 R10096015 R10096019 R10096024 R10096025 R10096026 R10096027";
72  } else if(strstr("run9setC",set)>0) {
73  char *runL=" R10096141 R10097003 R10097004 R10097005 R10097008 R10097012 R10097016 R10097019 R10097021 R10097022 R10097026 R10097028 R10097029 R10097030 R10097038 R10097040 R10097044 R10097045 R10097087 R10097089 R10097091 R10097102 R10097104 R10097106 R10097108 R10097110 R10097117 R10097118 R10097137 R10097140 R10097145 R10097146 R10097149 R10097153 R10098029 R10098035 R10098038 R10098040 R10098045 R10099028 R10099029 R10099055 R10099057 R10099066 R10099067 R10099071 R10099073 R10099074 R10099076 R10099077 R10099078 R10099185 R10099186 R10099187 R10099188 R10099189 R10099194 R10099195 R10100005 R10100006 R10100008 R10100013 R10100014 R10100015 R10100016 R10100017 R10100021 R10100028 R10100029 R10100032 R10100067 R10100068 R10100070 R10100071 R10100072 R10100077 R10100079 R10100081 R10100093 R10100095 R10100098 R10100164 R10100165 R10100166 R10100167 R10100169 R10100172 R10100175 R10100176 R10100177 R10100178 R10100179 R10100180 R10101001 R10101005 R10101006 R10101008 R10101009 R10101011 R10101016 R10101017 R10101018 R10101019 R10101020"; //total: 104
74  } else if(strstr("run9setD",set)>0) {
75  char *runL="R10101028 R10101029 R10101030 R10101037 R10101038 R10101039 R10101040 R10101059 R10101060 R10101061 R10101064 R10101065 R10101069 R10101070 R10101071 R10101074 R10101075 R10101076 R10101078 R10101081 R10101082 R10101083 R10101086 R10101088 R10101089 R10101090 R10101091 R10101092 R10101093 R10101094 R10102003 R10102031 R10102033 R10102036 R10102037 R10102039 R10102045 R10102046 R10102048 R10102050 R10102051 R10102055 R10102056 R10102062 R10102063 R10102065 R10102066 R10102069 R10102070 R10102094 R10102095 R10102096 R10102098 R10102100 R10102104 R10102105 R10102107 R10102108 R10102109 R10102110 R10102112 R10103001 R10103007 R10103008 R10103010 R10103011 R10103012 R10103015 R10103016 R10103017 R10103018 R10103027 R10103028 R10103031 R10103033 R10103034 R10103041 R10103042"; //total: 78
76  } else if(strstr("run9setABCD",set)>0) {
77  char *runL="run9setA run9setB run9setC run9setD "; //total 589 for setABCD
78  } else if(strstr("production2009_500Gev_c_1",set)>0) {
79  char *runL="R10085131 R10085132 R10085133 R10085134 R10085135 R10085136 R10085140 R10086001 R10086007 R10086008 R10086015 R10086022 R10086023 R10086024 R10086037 R10086043 R10086044 R10086046 R10087001 R10087009 R10087011 R10087012 R10087018 R10087020 R10087021 R10087022 R10087023 R10087025 R10087028 R10087031 R10087032 R10087033 R10087034 R10087035 R10087036 R10087037 R10087041 R10087051 R10087052 R10087053 R10087054 R10087057 R10087058 R10087059 R10087062 R10087063 R10087065 R10087067 R10087069 R10087070 R10087071 R10087077 R10087078 R10087082 R10087084 R10087085 R10087088 R10087094 R10087096 R10087097 R10087114 R10087117 R10087119 R10087125 R10087126 R10088001 R10088010 R10088011 R10088013 R10088022 R10088024 R10088026 R10088027 R10088028 R10088029 R10088030 R10088031 R10088036 R10088058 R10088062 R10088063 R10088069 R10088070 R10088071 R10088075 R10088077 R10088081 R10088084 R10088085 R10088096 R10088102 R10088110 R10088111 R10088112 R10088113 R10089008 R10089010 R10089011 R10089015 R10089016 R10089019 R10089021 R10089023 R10090001 R10090004 R10090005 R10090008 R10090013 R10090015 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10090037 R10090038 R10090040 R10090042 R10090046 R10090047 R10090072 R10090074 R10090076 R10090079 R10090080 R10090081 R10090089 R10090095 R10090100 R10090108 R10090109 R10090111 R10090112 R10091089 R10091090 R10092002 R10092004 R10092009 R10092011 R10092021 R10092022 R10092023 R10092024 R10092027 R10092028 R10092029 R10092030 R10092031 R10092033 R10092034 R10092036 R10092037 R10092038 R10092039 R10092040 R10092042 R10092046 R10092047 R10092048 R10092049 R10092050 R10092084 R10092098 R10092102 R10092105 R10092107 R10093082 R10093083 R10093084 R10093131 R10094003 R10094005 R10094006 R10094007 R10094016 R10094019 R10094021 R10094022 R10094023 R10094024 R10094063 R10094067 R10094071 R10094073 R10094078 R10094084 R10094088 R10094089 R10094090 R10094092 R10094095 R10094096 R10094098 R10094099 R10094100 R10095022 R10095023 R10095024 R10095030 R10095036 R10095037 R10095039 R10095040 R10095041 R10095045 R10095046 R10095047 R10095048 R10095049 R10095050 R10095051 R10095052 R10095056 R10095057 R10095120 R10095121 R10095122 R10095125"; //
80  } else if(strstr("production2009_500Gev_c_2",set)>0) {
81  char *runL="R10096001 R10096002 R10096005 R10096006 R10096007 R10096008 R10096009 R10096014 R10096015 R10096019 R10096024 R10096025 R10096026 R10096027 R10096141 R10097003 R10097004 R10097005 R10097008 R10097012 R10097016 R10097019 R10097021 R10097022 R10097026 R10097028 R10097029 R10097030 R10097038 R10097040 R10097044 R10097045 R10097087 R10097089 R10097091 R10097102 R10097104 R10097106 R10097108 R10097110 R10097117 R10097118 R10097137 R10097140 R10097145 R10097146 R10097149 R10097153 R10098029 R10098035 R10098038 R10098040 R10098045 R10099028 R10099029 R10099055 R10099057 R10099066 R10099067 R10099071 R10099073 R10099074 R10099076 R10099077 R10099078 R10099185 R10099186 R10099187 R10099188 R10099189 R10099194 R10099195 R10100005 R10100006 R10100008 R10100013 R10100014 R10100015 R10100016 R10100017 R10100021 R10100028 R10100029 R10100032 R10100067 R10100068 R10100070 R10100071 R10100072 R10100077 R10100079 R10100081 R10100093 R10100095 R10100098 R10100164 R10100165 R10100166 R10100167 R10100169 R10100172 R10100175 R10100176 R10100177 R10100178 R10100179 R10100180 R10101001 R10101005 R10101006 R10101008 R10101009 R10101011 R10101016 R10101017 R10101018 R10101019 R10101020 R10101028 R10101029 R10101030 R10101037 R10101038 R10101039 R10101040 R10101059 R10101060 R10101061 R10101064 R10101065 R10101069 R10101070 R10101071 R10101074 R10101075 R10101076 R10101078 R10101081 R10101082 R10101083 R10101086 R10101088 R10101089 R10101090 R10101091 R10101092 R10101093 R10101094 R10102003 R10102031 R10102033 R10102036 R10102037 R10102039 R10102045 R10102046 R10102048 R10102050 R10102051 R10102055 R10102056 R10102062 R10102063 R10102065 R10102066 R10102069 R10102070 R10102094 R10102095 R10102096 R10102098 R10102100 R10102104 R10102105 R10102107 R10102108 R10102109 R10102110 R10102112 R10103001 R10103007 R10103008 R10103010 R10103011 R10103012 R10103015 R10103016 R10103017 R10103018 R10103027 R10103028 R10103031 R10103033 R10103034 R10103041 R10103042"; //
82  } else if(strstr("production2009_500Gev_c_all",set)>0) {
83  char *runL="production2009_500Gev_c_1 production2009_500Gev_c_2";
84  } else if(strstr("jamie_1",set)>0) {
85  char *runL="R10085113 R10085114 R10085115 R10085131 R10085132 R10085133 R10085134 R10085135 R10085136 R10085140 R10086001 R10086007 R10086008 R10086015 R10086022 R10086023 R10086024 R10086037 R10086043 R10086044 R10086046 R10087009 R10087011 R10087012 R10087018 R10087020 R10087021 R10087022 R10087023 R10087025 R10087028 R10087031 R10087032 R10087033 R10087034 R10087035 R10087036 R10087037 R10087041 R10087051 R10087052 R10087053 R10087054 R10087057 R10087058 R10087059 R10087062 R10087063 R10087065 R10087067 R10087069 R10087070 R10087071 R10087077 R10087082 R10087084 R10087085 R10087088 R10087094 R10087096 R10087097 R10088010 R10088011 R10088013 R10088022 R10088024 R10088026 R10088027 R10088028 R10088029 R10088030 R10088031 R10088036 R10088058 R10088062 R10088063 R10088069 R10088070 R10088071 R10088077 R10088081 R10088084 R10088085 R10088096 R10088102 R10088111 R10088113 R10089008 R10089010 R10089011 R10089015 R10089016 R10089019 R10089021 R10089023 R10089080 R10089081 R10090001 R10090004 R10090005 R10090013 R10090015 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10090037 R10090038 R10090040 R10090042 R10090046 R10090047 R10090072 R10090074 R10090076 R10090079 R10090080 R10090081 R10090089 R10090095 R10090100 R10090108 R10090109 R10090111 R10090112 R10092004 R10092009 R10092011 R10092021 R10092024 R10092027 R10092028 R10092029 R10092030 R10092031 R10092033 R10092034 R10092036 R10092037 R10092038 R10092039 R10092040 R10092042 R10092046 R10092047 R10092048 R10092049 R10092050 R10092105 R10092107 R10093082 R10093083 R10093084 R10094003 R10094005 R10094006 R10094007 R10094019 R10094021 R10094022 R10094023 R10094024 R10094063 R10094067 R10094071 R10094073 R10094078 R10094084 R10094088 R10094089 R10094090 R10094092 R10094095 R10094096 R10094098 R10094099 R10095022 R10095024 R10095030 R10095036 R10095037 R10095039 R10095040 R10095041 R10095045 R10095046 R10095047 R10095048 R10095049 R10095050 R10095051 R10095052 R10095120 R10095121 R10095125";
86  } else if(strstr("jamie_2",set)>0) {
87  char *runL="R10096001 R10096002 R10096005 R10096006 R10096007 R10096008 R10096009 R10096014 R10096015 R10096019 R10096025 R10096026 R10096027 R10096141 R10097008 R10097016 R10097019 R10097021 R10097022 R10097026 R10097029 R10097030 R10097038 R10097040 R10097044 R10097045 R10097087 R10097089 R10097102 R10097104 R10097106 R10097108 R10097110 R10097137 R10097140 R10098029 R10098035 R10098038 R10098040 R10098045 R10099185 R10099186 R10099187 R10099188 R10099189 R10099194 R10099195 R10100006 R10100008 R10100013 R10100014 R10100015 R10100016 R10100017 R10100021 R10100028 R10100029 R10100032 R10100068 R10100070 R10100071 R10100072 R10100077 R10100079 R10100081 R10100093 R10100095 R10100098 R10100164 R10100165 R10100166 R10100169 R10100172 R10100175 R10100176 R10100178 R10100179 R10100180 R10101001 R10101006 R10101008 R10101009 R10101011 R10101016 R10101018 R10101019 R10101020 R10101029 R10101030 R10101037 R10101038 R10101039 R10101040 R10101059 R10101060 R10101061 R10101064 R10101065 R10101069 R10101070 R10101071 R10101074 R10101078 R10101081 R10101083 R10101086 R10101088 R10101089 R10101090 R10101091 R10101092 R10101094 R10102003 R10102031 R10102033 R10102036 R10102037 R10102039 R10102045 R10102046 R10102048 R10102050 R10102051 R10102055 R10102056 R10102062 R10102063 R10102065 R10102066 R10102069 R10102070 R10102094 R10102095 R10102096 R10102098 R10102100 R10102104 R10102105 R10102107 R10102108 R10102109 R10102110 R10102112 R10103001 R10103007 R10103008 R10103010 R10103011 R10103012 R10103015 R10103016 R10103017 R10103018 R10103027 R10103028 R10103031 R10103034 R10103041 R10103042";
88  } else if(strstr("jamie_all",set)>0) {
89  char *runL="jamie_1 jamie_2";
90  } else if(strstr("higherTpcHV",set)>0) {
91  char *runL="run9setA run9setB_highHV";
92  } else if(strstr("lowerTpcHV",set)>0) {
93  char *runL="run9setB_lowHV run9setC run9setD";
94  } else if(strstr("zdcRateLow",set)>0) {
95  char *runL="zdcRateLow1 zdcRateLow2";
96  } else if(strstr("zdcRateLow1",set)>0) {
97  char *runL="R10079057 R10079059 R10079060 R10079061 R10079062 R10079063 R10079069 R10079070 R10079071 R10079074 R10079078 R10079079 R10079080 R10079081 R10087119 R10076161 R10076154 R10076153 R10076152 R10090047 R10076136 R10076134 R10090046 R10086046 R10090042 R10086044 R10086043 R10086037 R10090111 R10086024 R10086023 R10086022 R10090040 R10090109 R10090108 R10090112 R10086015 R10090100 R10082095 R10086008 R10082091 R10092050 R10078094 R10082092 R10082093 R10078093 R10082083 R10082085 R10092049 R10086007 R10079017 R10092048 R10078092 R10079016 R10090038 R10082078 R10079015 R10090095 R10082077 R10092047 R10082076 R10086001 R10082075 R10092046 R10082074 R10079007 R10078081 R10078082 R10082073 R10085140 R10079006 R10082072 R10085136 R10079005 R10078078 R10079004 R10090037 R10078077 R10092042 R10088036 R10081056 R10080081 R10082071 R10079002 R10090089 R10085135 R10081055 R10080080 R10081053 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10092040 R10092039 R10088031 R10088085 R10085134 R10085039 R10080078 R10092038 R10085038 R10094100 R10090015 R10080077 R10085133 R10085132 R10088030 R10088029 R10092037 R10080076 R10081047 R10085131 R10088084 R10094099 R10092036 R10083058 R10087097 R10088028 R10087078 R10092034 R10088027 R10087094 R10087041 R10083052 R10087096 R10088026 R10094098 R10083056 R10083055 R10080062 R10088081 R10092033 R10083054 R10092031 R10090013 R10088024 R10080061 R10083053 R10094096 R10087077 R10088022 R10087088 R10085032 R10087037 R10083047 R10089023 R10092030 R10087036 R10094095 R10083045 R10085031 R10092029 R10089021 R10088077 R10087035 R10087085 R10097045 R10087034 R10094092 R10090008 R10085030 R10087084 R10082043 R10089019 R10087033 R10081027 R10085029 R10087082 R10083041 R10087032 R10092028 R10090005 R10081026 R10097044 R10094090 R10083040 R10090004 R10088013 R10085028 R10087031 R10089016 R10082035 R10088075 R10092027 R10099078 R10096027 R10088011 R10089015 R10094089 R10085115 R10082032 R10085027 R10088010 R10083037 R10087071 R10089011 R10087028 R10092024 R10082031 R10099077 R10097040 R10092023 R10094088 R10099076 R10085113 R10096026 R10085114 R10103018 R10092022 R10088001 R10092021 R10079050 R10085026 R10089010 R10088071 R10099074 R10082029 R10097038 R10094084 R10079049 R10087070 R10085025 R10083034 R10088070 R10081013 R10083033 R10089008 R10099073 R10096025 R10087025 R10082027 R10103017 R10087023 R10079047 R10087022 R10094078 R10087069 R10079046 R10085024 R10085023 R10099071 R10096024 R10088069 R10083032 R10103016 R10079045 R10097030 R10087021 R10090081 R10099067 R10097029 R10103015 R10082022 R10089004 R10087067 R10085109 R10096019 R10100032 R10103042 R10089001 R10082021 R10081007 R10087020 R10085108 R10079042 R10095057 R10082018 R10103012 R10085018 R10085107 R10079040 R10083028 R10090080 R10080042 R10085019 R10095056 R10087065 R10097028 R10100029 R10103041 R10083027 R10087126 R10099066 R10088121 R10094073 R10103011 R10090079";
98  } else if(strstr("zdcRateLow2",set)>0) {
99  char *runL="R10083026 R10103010 R10103008 R10080040 R10088120 R10100028 R10087125 R10096015 R10087018 R10085017 R10096014 R10094071 R10084024 R10087063 R10097026 R10094024 R10087062 R10085016 R10094067 R10095052 R10102070 R10085104 R10097153 R10082011 R10095051 R10103007 R10094023 R10084022 R10095050 R10102069 R10088113 R10090076 R10097149 R10098045 R10099057 R10083019 R10079035 R10097022 R10088063 R10094022 R10097146 R10083018 R10084021 R10096009 R10079034 R10092011 R10097145 R10094021 R10095049";
100  } else if(strstr("zdcRateHigh",set)>0) {
101  char *runL="R10082008 R10087059 R10101020 R10099055 R10090001 R10097021 R10103034 R10088112 R10102003 R10103033 R10079033 R10095048 R10097140 R10088062 R10101019 R10090074 R10079031 R10096008 R10088111 R10102066 R10094063 R10094019 R10102065 R10083013 R10095047 R10098040 R10101018 R10087117 R10092009 R10101017 R10096007 R10095046 R10103031 R10079030 R10101094 R10082005 R10101093 R10093084 R10101016 R10093082 R10088110 R10102063 R10095045 R10103001 R10098038 R10094016 R10097019 R10100021 R10093083 R10079028 R10087012 R10097137 R10087058 R10101092 R10096006 R10101011 R10102062 R10087011 R10096005 R10087114 R10090072 R10101009 R10082003 R10079027 R10098035 R10095041 R10087057 R10101091 R10102112 R10097016 R10088058 R10087009 R10101090 R10084011 R10092004 R10100017 R10095040 R10081117 R10096002 R10100098 R10103028 R10094007 R10102056 R10081115 R10101089 R10101008 R10097118 R10100016 R10095039 R10102110 R10102055 R10101006 R10088102 R10097117 R10102109 R10101088 R10100095 R10101005 R10084010 R10092002 R10094006 R10096001 R10100093 R10087054 R10095037 R10099029 R10102051 R10080022 R10094005 R10098029 R10100015 R10095036 R10079139 R10101086 R10099028 R10102108 R10097012 R10101001 R10079138 R10097110 R10100014 R10102107 R10092107 R10091090 R10095125 R10097108 R10094003 R10102050 R10079137 R10087053 R10080020 R10100180 R10092105 R10100013 R10087001 R10081112 R10102105 R10100179 R10101083 R10088096 R10097106 R10100081 R10081111 R10079135 R10097008 R10102048 R10101082 R10100008 R10095030 R10097104 R10091089 R10087052 R10092102 R10102045 R10101081 R10097102 R10081110 R10080019 R10095122 R10102104 R10092098 R10102046 R10100079 R10100006 R10101078 R10093131 R10097005 R10100178 R10095121 R10103027 R10100177 R10081108 R10100077 R10097004 R10101076 R10087051 R10081107 R10079131 R10100005 R10095120 R10097003 R10095024 R10095023 R10100176 R10089081 R10079130 R10101075 R10102100 R10100072 R10089080 R10081104 R10079129 R10100175 R10101074 R10095022 R10102039 R10092084 R10102098 R10089079 R10100172 R10100071 R10102037 R10101071 R10097091 R10081102 R10101040 R10102036 R10096141 R10099195 R10100070 R10101070 R10102096 R10099194 R10102095 R10097089 R10101039 R10100068 R10100169 R10101069 R10100067 R10101038 R10101037 R10100167 R10097087 R10102033 R10101065 R10099189 R10081096 R10102094 R10100166 R10099188 R10101064 R10100165 R10102031 R10101061 R10099187 R10101030 R10100164 R10101060 R10099186 R10101029 R10101059 R10099185 R10101028";
102  } else if(strstr("zdcRateA",set)>0) {
103  char *runL="R10079057 R10079059 R10079060 R10079061 R10079062 R10079063 R10079069 R10079070 R10079071 R10079074 R10079078 R10079079 R10079080 R10079081 R10087119 R10076161 R10076154 R10076153 R10076152 R10090047 R10076136 R10076134 R10090046 R10086046 R10090042 R10086044 R10086043 R10086037 R10090111 R10086024 R10086023 R10086022 R10090040 R10090109 R10090108 R10090112 R10086015 R10090100 R10082095 R10086008 R10082091 R10092050 R10078094 R10082092 R10082093 R10078093 R10082083 R10082085 R10092049 R10086007 R10079017 R10092048 R10078092 R10079016 R10090038 R10082078 R10079015 R10090095 R10082077 R10092047 R10082076 R10086001 R10082075 R10092046 R10082074 R10079007 R10078081 R10078082 R10082073 R10085140 R10079006 R10082072 R10085136 R10079005 R10078078 R10079004 R10090037 R10078077 R10092042 R10088036 R10081056 R10080081 R10082071 R10079002 R10090089 R10085135 R10081055 R10080080 R10081053 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10092040 R10092039 R10088031 R10088085 R10085134 R10085039 R10080078 R10092038 R10085038 R10094100 R10090015 R10080077 R10085133 R10085132 R10088030 R10088029 R10092037 R10080076 R10081047 R10085131 R10088084 R10094099 R10092036 R10083058 R10087097 R10088028 R10087078 R10092034 R10088027 R10087094 R10087041 R10083052 R10087096 R10088026 R10094098 R10083056 R10083055 R10080062 R10088081 R10092033 R10083054 R10092031 R10090013 R10088024 R10080061 R10083053 R10094096 R10087077 R10088022 R10087088 R10085032 R10087037 R10083047 R10089023 R10092030 R10087036 R10094095 R10083045 R10085031 R10092029 R10089021 R10088077 R10087035 R10087085 R10097045 R10087034 R10094092 R10090008 R10085030 R10087084 R10082043 R10089019 R10087033 R10081027 R10085029 R10087082 R10083041 R10087032 R10092028 R10090005 R10081026 R10097044 R10094090 R10083040 R10090004 R10088013 R10085028 R10087031 R10089016 R10082035 R10088075 R10092027 R10099078 R10096027 R10088011 R10089015 R10094089 R10085115 R10082032 R10085027 R10088010 R10083037 R10087071 R10089011 R10087028 R10092024 R10082031 R10099077 R10097040 R10092023 R10094088 R10099076 R10085113 R10096026 R10085114 R10103018 R10092022 R10088001 R10092021 R10079050 R10085026 R10089010 R10088071 R10099074 R10082029 R10097038 R10094084 R10079049 R10087070 R10085025 R10083034 R10088070 R10081013 R10083033 R10089008 R10099073 R10096025 R10087025 R10082027 R10103017 R10087023 R10079047 R10087022 R10094078 R10087069 R10079046 R10085024 R10085023 R10099071 R10096024 R10088069 R10083032 R10103016 R10079045 R10097030 R10087021 R10090081 R10099067 R10097029 R10103015 R10082022 R10089004 R10087067 R10085109 R10096019 R10100032 R10103042 R10089001 R10082021";
104  } else if(strstr("zdcRateB",set)>0) {
105  char *runL="R10081007 R10087020 R10085108 R10079042 R10095057 R10082018 R10103012 R10085018 R10085107 R10079040 R10083028 R10090080 R10080042 R10085019 R10095056 R10087065 R10097028 R10100029 R10103041 R10083027 R10087126 R10099066 R10088121 R10094073 R10103011 R10090079 R10083026 R10103010 R10103008 R10080040 R10088120 R10100028 R10087125 R10096015 R10087018 R10085017 R10096014 R10094071 R10084024 R10087063 R10097026 R10094024 R10087062 R10085016 R10094067 R10095052 R10102070 R10085104 R10097153 R10082011 R10095051 R10103007 R10094023 R10084022 R10095050 R10102069 R10088113 R10090076 R10097149 R10098045 R10099057 R10083019 R10079035 R10097022 R10088063 R10094022 R10097146 R10083018 R10084021 R10096009 R10079034 R10092011 R10097145 R10094021 R10095049 R10082008 R10087059 R10101020 R10099055 R10090001 R10097021 R10103034 R10088112 R10102003 R10103033 R10079033 R10095048 R10097140 R10088062 R10101019 R10090074 R10079031 R10096008 R10088111 R10102066 R10094063 R10094019 R10102065 R10083013 R10095047 R10098040 R10101018 R10087117 R10092009 R10101017 R10096007 R10095046 R10103031 R10079030 R10101094 R10082005 R10101093 R10093084 R10101016 R10093082 R10088110 R10102063 R10095045 R10103001 R10098038 R10094016 R10097019 R10100021 R10093083 R10079028 R10087012 R10097137 R10087058 R10101092 R10096006 R10101011 R10102062 R10087011 R10096005 R10087114 R10090072 R10101009 R10082003 R10079027 R10098035 R10095041 R10087057 R10101091 R10102112 R10097016";
106  } else if(strstr("zdcRateC",set)>0) {
107  char *runL="R10088058 R10087009 R10101090 R10084011 R10092004 R10100017 R10095040 R10081117 R10096002 R10100098 R10103028 R10094007 R10102056 R10081115 R10101089 R10101008 R10097118 R10100016 R10095039 R10102110 R10102055 R10101006 R10088102 R10097117 R10102109 R10101088 R10100095 R10101005 R10084010 R10092002 R10094006 R10096001 R10100093 R10087054 R10095037 R10099029 R10102051 R10080022 R10094005 R10098029 R10100015 R10095036 R10079139 R10101086 R10099028 R10102108 R10097012 R10101001 R10079138 R10097110 R10100014 R10102107 R10092107 R10091090 R10095125 R10097108 R10094003 R10102050 R10079137 R10087053 R10080020 R10100180 R10092105 R10100013 R10087001 R10081112 R10102105 R10100179 R10101083 R10088096 R10097106 R10100081 R10081111 R10079135 R10097008 R10102048 R10101082 R10100008 R10095030 R10097104 R10091089 R10087052 R10092102 R10102045 R10101081 R10097102 R10081110 R10080019 R10095122 R10102104 R10092098 R10102046 R10100079 R10100006 R10101078 R10093131 R10097005 R10100178 R10095121 R10103027 R10100177 R10081108 R10100077 R10097004 R10101076 R10087051 R10081107 R10079131 R10100005 R10095120 R10097003 R10095024 R10095023 R10100176 R10089081 R10079130 R10101075 R10102100 R10100072 R10089080 R10081104 R10079129 R10100175 R10101074 R10095022 R10102039 R10092084 R10102098 R10089079 R10100172 R10100071 R10102037 R10101071 R10097091 R10081102 R10101040 R10102036 R10096141 R10099195 R10100070 R10101070 R10102096 R10099194 R10102095 R10097089 R10101039 R10100068 R10100169 R10101069 R10100067 R10101038 R10101037 R10100167 R10097087 R10102033 R10101065 R10099189 R10081096 R10102094 R10100166 R10099188 R10101064 R10100165 R10102031 R10101061 R10099187 R10101030 R10100164 R10101060 R10099186 R10101029 R10101059 R10099185 R10101028";
108  } else if(strstr("run9setP1",set)>0) {
109  char *runL="R10083013 R10083018 R10083019 R10083026 R10083027 R10083028 R10083032 R10083033 R10083034 R10083037 R10083040 R10083041 R10083045 R10083047 R10083052 R10083053 R10083054 R10083055 R10083056 R10083058 R10087051 R10087052 R10087053 R10087054 R10087057 R10087058 R10087059 R10087062 R10087063 R10087065 R10087067 R10087069 R10087070 R10087071 R10087077 R10087078 R10087082 R10087084 R10087085 R10087088 R10087094 R10087096 R10087097 R10093131 R10094003 R10094005 R10094006 R10094007 R10094016 R10094019 R10094021 R10094022 R10094023 R10094024 R10097087 R10097089 R10097091 R10097102 R10097104 R10097106 R10097108 R10097110 R10097117 R10097118 R10097137 R10097140 R10097145 R10097146 R10097149 R10097153 R10100067 R10100068 R10100070 R10100071 R10100072 R10100077 R10100079 R10100081 R10100093 R10100095 R10100098 R10102031 R10102033 R10102036 R10102037 R10102039 R10102045 R10102046 R10102048 R10102050 R10102051 R10102055 R10102056 R10102062 R10102063 R10102065 R10102066 R10102069 R10102070"; //total: 102
110  } else if(strstr("run9setP2",set)>0) {
111  char *runL="R10084010 R10084011 R10084021 R10084022 R10084024 R10085016 R10085017 R10085018 R10085019 R10085023 R10085024 R10085025 R10085026 R10085027 R10085028 R10085029 R10085030 R10085031 R10085032 R10085038 R10085039 R10087114 R10087117 R10087119 R10087125 R10087126 R10088001 R10088010 R10088011 R10088013 R10088022 R10088024 R10088026 R10088027 R10088028 R10088029 R10088030 R10088031 R10088036 R10089079 R10089080 R10089081 R10090001 R10090004 R10090005 R10090008 R10090013 R10090015 R10090017 R10090018 R10090019 R10090020 R10090022 R10090026 R10090027 R10091089 R10091090 R10092002 R10092004 R10092009 R10092011 R10092021 R10092022 R10092023 R10092024 R10092027 R10092028 R10092029 R10092030 R10092031 R10092033 R10092034 R10092036 R10092037 R10092038 R10092039 R10092040 R10092042 R10092046 R10092047 R10092048 R10092049 R10092050 R10094063 R10094067 R10094071 R10094073 R10094078 R10094084 R10094088 R10094089 R10094090 R10094092 R10094095 R10094096 R10094098 R10094099 R10094100 R10098029 R10098035 R10098038 R10098040 R10098045 R10100164 R10100165 R10100166 R10100167 R10100169 R10100172 R10100175 R10100176 R10100177 R10100178 R10100179 R10100180 R10101001 R10101005 R10101006 R10101008 R10101009 R10101011 R10101016 R10101017 R10101018 R10101019 R10101020 R10102094 R10102095 R10102096 R10102098 R10102100 R10102104 R10102105 R10102107 R10102108 R10102109 R10102110 R10102112 R10103001 R10103007 R10103008 R10103010 R10103011 R10103012 R10103015 R10103016 R10103017 R10103018 R10103027 R10103028 R10103031 R10103033 R10103034 R10103041 R10103042"; //total: 155
112  } else if(strstr("run9setP3",set)>0) {
113  char *runL="R10081007 R10081013 R10081026 R10081027 R10081047 R10081053 R10081055 R10081056 R10085104 R10085107 R10085108 R10085109 R10085113 R10085114 R10085115 R10085131 R10085132 R10085133 R10085134 R10085135 R10085136 R10085140 R10086001 R10086007 R10086008 R10086015 R10086022 R10086023 R10086024 R10086037 R10086043 R10086044 R10086046 R10088058 R10088062 R10088063 R10088069 R10088070 R10088071 R10088075 R10088077 R10088081 R10088084 R10088085 R10092084 R10092098 R10092102 R10092105 R10092107 R10095022 R10095023 R10095024 R10095030 R10095036 R10095037 R10095039 R10095040 R10095041 R10095045 R10095046 R10095047 R10095048 R10095049 R10095050 R10095051 R10095052 R10095056 R10095057 R10095120 R10095121 R10095122 R10095125 R10096001 R10096002 R10096005 R10096006 R10096007 R10096008 R10096009 R10096014 R10096015 R10096019 R10096024 R10096025 R10096026 R10096027 R10099028 R10099029 R10099055 R10099057 R10099066 R10099067 R10099071 R10099073 R10099074 R10099076 R10099077 R10099078 "; //total: 111 -sth
114  } else if(strstr("run9setP4",set)>0) {
115  char *runL="R10081096 R10081102 R10081104 R10081107 R10081108 R10081110 R10081111 R10081112 R10081115 R10081117 R10082003 R10082005 R10082008 R10082011 R10082018 R10082021 R10082022 R10082027 R10082029 R10082031 R10082032 R10082035 R10082043 R10082071 R10082072 R10082073 R10082074 R10082075 R10082076 R10082077 R10082078 R10082083 R10082085 R10082091 R10082092 R10082093 R10082095 R10087001 R10087009 R10087011 R10087012 R10087018 R10087020 R10087021 R10087022 R10087023 R10087025 R10087028 R10087031 R10087032 R10087033 R10087034 R10087035 R10087036 R10087037 R10087041 R10088096 R10088102 R10088110 R10088111 R10088112 R10088113 R10088120 R10088121 R10089001 R10089004 R10089008 R10089010 R10089011 R10089015 R10089016 R10089019 R10089021 R10089023 R10090072 R10090074 R10090076 R10090079 R10090080 R10090081 R10090089 R10090095 R10090100 R10090108 R10090109 R10090111 R10090112 R10093082 R10093083 R10093084 R10096141 R10097003 R10097004 R10097005 R10097008 R10097012 R10097016 R10097019 R10097021 R10097022 R10097026 R10097028 R10097029 R10097030 R10097038 R10097040 R10097044 R10097045 R10099185 R10099186 R10099187 R10099188 R10099189 R10099194 R10099195 R10100005 R10100006 R10100008 R10100013 R10100014 R10100015 R10100016 R10100017 R10100021 R10100028 R10100029 R10100032 R10101059 R10101060 R10101061 R10101064 R10101065 R10101069 R10101070 R10101071 R10101074 R10101075 R10101076 R10101078 R10101081 R10101082 R10101083 R10101086 R10101088 R10101089 R10101090 R10101091 R10101092 R10101093 R10101094 R10102003"; //total: 153
116  } else if(strstr("run9setP1234",set)>0) {
117  char *runL="run9setP1 run9setP2 run9setP3 run9setP4"; //total: NNN
118  } else if(strstr("setXX",set)>0) {
119  char *runL="HHHHH "; //total: NNN
120  } else {
121  printf(" hadd: set=%s= NOT found, quit\n",set); return; }
122  printf(" hadd: set=%s= path=%s= ...\n",set,iPath.Data());
123  out+=set;
124  Target = TFile::Open( out+".wana.hist.root", "RECREATE" );
125  FileList = new TList();
126  printf("sum Output '%s' \n",Target->GetName());
127 
128  char *run=strtok(runL," "); // init 'strtok'
129  int i=1;
130  do {
131  printf("add run %d '%s' \n",i++,run);
132  if(isAPS2010pol && strstr(set,"run9setP")>0 ) { // remove runs from fills w/o official pol for APS-2010
133  int irun=atoi(run+1);
134  if(irun>=10083013 && irun<=10083058) { printf("\tdrop %s from F10415\n",run); continue;}
135  if(irun>=10098015 && irun<=10098015) { printf("\tdrop %s from F10508\n",run); continue;}
136  }
137  TString fullName=iPath+run+".wana.hist.root";
138  FileList->Add( TFile::Open(fullName));
139  } while(run=strtok(0," ")); // advance by one nam
140 
141  MergeRootfile( Target, FileList );
142  printf("finished Output '%s' \n",Target->GetName());
143 
144 }
145 
146 void MergeRootfile( TDirectory *target, TList *sourcelist ) {
147 
148  cout << "Target path: " << target->GetPath() << endl;
149  TString path( (char*)strstr( target->GetPath(), ":" ) );
150  path.Remove( 0, 2 );
151 
152  TFile *first_source = (TFile*)sourcelist->First();
153  first_source->cd( path );
154  TDirectory *current_sourcedir = gDirectory;
155 
156  int nh=0;
157  // loop over all keys in this directory
158  TChain *globChain = 0;
159  TIter nextkey( current_sourcedir->GetListOfKeys() );
160  TKey *key;
161  while ( (key = (TKey*)nextkey())) {
162  const char *name=key->GetName();
163  nh++;
164  if(nh%100==0) printf("nh=%d addingX %s\n",nh,name);
165 
166  // read object from first source file
167  first_source->cd( path );
168  TObject *obj = key->ReadObj();
169 
170  if ( obj->IsA()->InheritsFrom( "TH1" ) ) {
171  // descendant of TH1 -> merge it
172 
173  // cout << "Merging histogram " << obj->GetName() << endl;
174  TH1 *h1 = (TH1*)obj;
175 
176  // loop over all source files and add the content of the
177  // correspondant histogram to the one pointed to by "h1"
178  TFile *nextsource = (TFile*)sourcelist->After( first_source );
179  while ( nextsource ) {
180 
181  // make sure we are at the correct directory level by cd'ing to path
182  nextsource->cd( path );
183  TH1 *h2 = (TH1*)gDirectory->Get( h1->GetName() );
184  if ( h2 ) {
185  h1->Add( h2 );
186  delete h2; // don't know if this is necessary, i.e. if
187  // h2 is created by the call to gDirectory above.
188  }
189 
190  nextsource = (TFile*)sourcelist->After( nextsource );
191  }
192  }
193  else if ( obj->IsA()->InheritsFrom( "TTree" ) ) {
194 
195  // loop over all source files create a chain of Trees "globChain"
196  const char* obj_name= obj->GetName();
197 
198  globChain = new TChain(obj_name);
199  globChain->Add(first_source->GetName());
200  TFile *nextsource = (TFile*)sourcelist->After( first_source );
201  // const char* file_name = nextsource->GetName();
202  // cout << "file name " << file_name << endl;
203  while ( nextsource ) {
204 
205  globChain->Add(nextsource->GetName());
206  nextsource = (TFile*)sourcelist->After( nextsource );
207  }
208 
209  } else if ( obj->IsA()->InheritsFrom( "TDirectory" ) ) {
210  // it's a subdirectory
211 
212  cout << "Found subdirectory " << obj->GetName() << endl;
213 
214  // create a new subdir of same name and title in the target file
215  target->cd();
216  TDirectory *newdir = target->mkdir( obj->GetName(), obj->GetTitle() );
217 
218  // newdir is now the starting point of another round of merging
219  // newdir still knows its depth within the target file via
220  // GetPath(), so we can still figure out where we are in the recursion
221  MergeRootfile( core,newdir, sourcelist );
222 
223  } else {
224 
225  // object is of no type that we know or can handle
226  cout << "Unknown object type, name: "
227  << obj->GetName() << " title: " << obj->GetTitle() << endl;
228  }
229 
230  // now write the merged histogram (which is "in" obj) to the target file
231  // note that this will just store obj in the current directory level,
232  // which is not persistent until the complete directory itself is stored
233  // by "target->Write()" below
234  if ( obj ) {
235  target->cd();
236 
238  if(obj->IsA()->InheritsFrom( "TTree" ))
239  globChain->Write( key->GetName() );
240  else
241  obj->Write( key->GetName() );
242  }
243 
244  } // while ( ( TKey *key = (TKey*)nextkey() ) )
245 
246  // save modifications to target file
247  target->Write();
248 
249 }
250 
251 
252 /*
253 
254  This macro will add histograms from a list of root files and write them
255  to a target root file. The target file is newly created and must not be
256  identical to one of the source files.
257 
258  Author: Sven A. Schmidt, sven.schmidt@cern.ch
259  Date: 13.2.2001
260 
261  This code is based on the hadd.C example by Rene Brun and Dirk Geppert,
262  which had a problem with directories more than one level deep.
263  (see macro hadd_old.C for this previous implementation).
264 
265  The macro from Sven has been enhanced by
266  Anne-Sylvie Nicollerat <Anne-Sylvie.Nicollerat@cern.ch>
267  to automatically add Trees (via a chain of trees).
268 
269  To use this macro, modify the file names in function hadd.
270 
271  NB: This macro is provided as a tutorial.
272  Use $ROOTSYS/bin/hadd to merge many histogram files
273 
274  */
275 
276 
277 
278 // $Log: haddWanaSL11b.C,v $
279 // Revision 1.1 2011/09/14 15:43:27 stevens4
280 // update used for cross section PRD paper
281 //
282 // Revision 1.18 2010/05/19 20:49:50 balewski
283 // removed 5 runs tagged by Ross
284 //
285 // Revision 1.17 2010/03/15 17:05:51 balewski
286 // cleanup, used for W AL sort March 15, 2010
287 //
288 // Revision 1.16 2010/03/14 19:37:27 balewski
289 // Removed F10383, has TPC problem according to Gene
290 //
291 // Revision 1.15 2010/02/24 18:26:24 balewski
292 // added macros computing/plotting AL
293 //
294 // Revision 1.14 2010/02/06 01:12:46 balewski
295 // skips unpol CNI fills
296 //
297 // Revision 1.13 2010/02/04 03:48:25 balewski
298 // add ET for lumi monitor
299 //
300 // Revision 1.12 2010/01/27 22:12:26 balewski
301 // spin code matched to x-section code
302 //
303 // Revision 1.11 2010/01/10 03:01:39 balewski
304 // cleanup & nicer histos
305 //
306 // Revision 1.10 2010/01/06 05:21:59 balewski
307 // cleanup
308 //
309 // Revision 1.9 2010/01/06 04:22:18 balewski
310 // added Q/PT plot for Zs, more cleanup
311 //
312 // Revision 1.8 2010/01/05 03:23:02 balewski
313 // change logic for filling btow status tables, added printout to Z-code
314 //
315 // Revision 1.7 2010/01/04 05:12:02 balewski
316 // added 4x4 cut to Z-algo, cleanup
317 //
318 // Revision 1.6 2010/01/03 04:38:27 balewski
319 // reorganized Z-algo
320 //
321 // Revision 1.5 2010/01/03 01:58:19 balewski
322 // run list for setABCD updated to SL09g
323 //
324 // Revision 1.4 2009/12/30 18:27:52 balewski
325 // after tag I added a test line
326 //
327 // Revision 1.3 2009/12/30 18:27:02 balewski
328 // added tag for testing
329 //
330 // Revision 1.2 2009/12/08 16:53:01 balewski
331 // *** empty log message ***
332 //
333 // Revision 1.1 2009/11/23 23:00:20 balewski
334 // code moved spin-pool
335 //