| 1 | 
mocchiut | 
1.1 | 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | 
| 2 | 
  | 
  | 
//  test routines | 
| 3 | 
  | 
  | 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | 
| 4 | 
  | 
  | 
 | 
| 5 | 
  | 
  | 
 | 
| 6 | 
  | 
  | 
void RootTest(TString filename){ | 
| 7 | 
  | 
  | 
    Long64_t ntimes = 0; | 
| 8 | 
  | 
  | 
 inizio: TFile       *calheadFile = 0; | 
| 9 | 
  | 
  | 
    TFile       *calcalibFile = 0; | 
| 10 | 
  | 
  | 
    calheadFile = getFile(filename, "CalibCalPed", "Header"); | 
| 11 | 
  | 
  | 
    calcalibFile = getFile(filename, "CalibCalPed");     | 
| 12 | 
  | 
  | 
    //Takes the tree of the header file | 
| 13 | 
  | 
  | 
    char *filen = 0; | 
| 14 | 
  | 
  | 
    filen = filename; | 
| 15 | 
  | 
  | 
    //gObjectTable->Print(); | 
| 16 | 
  | 
  | 
    if ( !calheadFile || !calcalibFile ) { | 
| 17 | 
  | 
  | 
        if ( calheadFile ) calheadFile->Close(); | 
| 18 | 
  | 
  | 
        if ( calcalibFile ) calcalibFile->Close(); | 
| 19 | 
  | 
  | 
        printf(" Not able to open file! %s \n",filen); | 
| 20 | 
  | 
  | 
        printf(" ntimes = %i\n",(int)ntimes); | 
| 21 | 
  | 
  | 
        ntimes++; | 
| 22 | 
  | 
  | 
        goto inizio; | 
| 23 | 
  | 
  | 
        return; | 
| 24 | 
  | 
  | 
    }; | 
| 25 | 
  | 
  | 
    TTree *tr = (TTree*)calheadFile->Get("Pscu"); | 
| 26 | 
  | 
  | 
    tr->AddFriend("CalibCalPed", calcalibFile); | 
| 27 | 
  | 
  | 
    //    pamela::calorimeter::CalibCalPedEvent *ce = 0; | 
| 28 | 
  | 
  | 
    pamela::CalibCalPedEvent *ce = 0; | 
| 29 | 
  | 
  | 
    pamela::PscuHeader *cph = 0; | 
| 30 | 
  | 
  | 
    pamela::EventHeader *ceh = 0; | 
| 31 | 
  | 
  | 
    tr->SetBranchAddress("Header", &ceh); | 
| 32 | 
  | 
  | 
    tr->SetBranchAddress("Event", &ce); | 
| 33 | 
  | 
  | 
    Long64_t ncalibs    = tr->GetEntries(); | 
| 34 | 
  | 
  | 
    calheadFile->Close(); | 
| 35 | 
  | 
  | 
    calcalibFile->Close(); | 
| 36 | 
  | 
  | 
    printf(" ntimes = %i\n",(int)ntimes); | 
| 37 | 
  | 
  | 
    ntimes++; | 
| 38 | 
  | 
  | 
    goto inizio; | 
| 39 | 
  | 
  | 
} | 
| 40 | 
  | 
  | 
 | 
| 41 | 
  | 
  | 
void RootTestE(TString filename){ | 
| 42 | 
  | 
  | 
    Long64_t ntimes = 0; | 
| 43 | 
  | 
  | 
 inizio:  | 
| 44 | 
  | 
  | 
    TString scalheadFile; | 
| 45 | 
  | 
  | 
    TString scalcalibFile; | 
| 46 | 
  | 
  | 
    scalheadFile = getEmiFile(filename, "CalibCalPed", "Header"); | 
| 47 | 
  | 
  | 
    scalcalibFile = getEmiFile(filename, "CalibCalPed","Event");     | 
| 48 | 
  | 
  | 
    char *prova; | 
| 49 | 
  | 
  | 
    prova = scalheadFile; | 
| 50 | 
  | 
  | 
    if ( prova == "nofile" ){ | 
| 51 | 
  | 
  | 
        printf("nofile\n"); | 
| 52 | 
  | 
  | 
        goto inizio; | 
| 53 | 
  | 
  | 
        return; | 
| 54 | 
  | 
  | 
    }; | 
| 55 | 
  | 
  | 
    TFile *calheadFile = 0; | 
| 56 | 
  | 
  | 
    calheadFile = new TFile(scalheadFile); | 
| 57 | 
  | 
  | 
    TFile *calcalibFile = 0; | 
| 58 | 
  | 
  | 
    calcalibFile = new TFile(scalcalibFile); | 
| 59 | 
  | 
  | 
    //    TFile *calheadFile = 0; | 
| 60 | 
  | 
  | 
    //calheadFile = new TFile(scalheadFile); | 
| 61 | 
  | 
  | 
    //TFile *calcalibFile = 0; | 
| 62 | 
  | 
  | 
    //calcalibFile = new TFile(scalcalibFile); | 
| 63 | 
  | 
  | 
    // | 
| 64 | 
  | 
  | 
    if ( calheadFile->IsZombie() || calcalibFile->IsZombie() ) { | 
| 65 | 
  | 
  | 
        if ( !calheadFile->IsZombie() ) calheadFile->Close(); | 
| 66 | 
  | 
  | 
        if ( !calcalibFile->IsZombie() ) calcalibFile->Close(); | 
| 67 | 
  | 
  | 
        printf(" Not able to open file! \n"); | 
| 68 | 
  | 
  | 
        printf(" ntimes = %i\n",ntimes); | 
| 69 | 
  | 
  | 
        ntimes++; | 
| 70 | 
  | 
  | 
        goto inizio; | 
| 71 | 
  | 
  | 
        return; | 
| 72 | 
  | 
  | 
    }; | 
| 73 | 
  | 
  | 
    TTree *tr = (TTree*)calheadFile->Get("Pscu"); | 
| 74 | 
  | 
  | 
    tr->AddFriend("CalibCalPed", calcalibFile); | 
| 75 | 
  | 
  | 
    //    pamela::calorimeter::CalibCalPedEvent *ce = 0; | 
| 76 | 
  | 
  | 
    pamela::CalibCalPedEvent *ce = 0; | 
| 77 | 
  | 
  | 
    pamela::PscuHeader *cph = 0; | 
| 78 | 
  | 
  | 
    pamela::EventHeader *ceh = 0; | 
| 79 | 
  | 
  | 
    tr->SetBranchAddress("Header", &ceh); | 
| 80 | 
  | 
  | 
    tr->SetBranchAddress("Event", &ce); | 
| 81 | 
  | 
  | 
    Long64_t ncalibs    = tr->GetEntries(); | 
| 82 | 
  | 
  | 
    calheadFile->Close(); | 
| 83 | 
  | 
  | 
    calcalibFile->Close(); | 
| 84 | 
  | 
  | 
    printf(" ntimes = %i\n",ntimes); | 
| 85 | 
  | 
  | 
    ntimes++; | 
| 86 | 
  | 
  | 
    goto inizio; | 
| 87 | 
  | 
  | 
} | 
| 88 | 
  | 
  | 
 | 
| 89 | 
  | 
  | 
void RootTest2(TString filename){ | 
| 90 | 
  | 
  | 
    Long64_t ntimes = 0; | 
| 91 | 
  | 
  | 
 inizio: TFile calcalibFile(filename); | 
| 92 | 
  | 
  | 
    if ( calcalibFile.IsZombie() ) { | 
| 93 | 
  | 
  | 
        if ( !calcalibFile.IsZombie() ) calheadFile.Close(); | 
| 94 | 
  | 
  | 
        printf(" Not able to open file! \n"); | 
| 95 | 
  | 
  | 
        printf(" ntimes = %i\n",ntimes); | 
| 96 | 
  | 
  | 
        ntimes++; | 
| 97 | 
  | 
  | 
        goto inizio; | 
| 98 | 
  | 
  | 
    }; | 
| 99 | 
  | 
  | 
    printf(" ntimes = %i\n",ntimes); | 
| 100 | 
  | 
  | 
    ntimes++; | 
| 101 | 
  | 
  | 
    goto inizio; | 
| 102 | 
  | 
  | 
} | 
| 103 | 
  | 
  | 
 | 
| 104 | 
  | 
  | 
void RootTest3(TString filename){ | 
| 105 | 
  | 
  | 
    Long64_t ntimes = 0; | 
| 106 | 
  | 
  | 
 inizio:      TFile *calcalibFile = 0; | 
| 107 | 
  | 
  | 
    calcalibFile = new TFile(filename); | 
| 108 | 
  | 
  | 
    if ( !calcalibFile ) { | 
| 109 | 
  | 
  | 
        if ( calcalibFile ) calheadFile.Close(); | 
| 110 | 
  | 
  | 
        printf(" Not able to open file! \n"); | 
| 111 | 
  | 
  | 
        printf(" ntimes = %i\n",ntimes); | 
| 112 | 
  | 
  | 
        ntimes++; | 
| 113 | 
  | 
  | 
        goto inizio; | 
| 114 | 
  | 
  | 
    }; | 
| 115 | 
  | 
  | 
    printf(" ntimes = %i\n",ntimes); | 
| 116 | 
  | 
  | 
    ntimes++; | 
| 117 | 
  | 
  | 
    goto inizio; | 
| 118 | 
  | 
  | 
} | 
| 119 | 
  | 
  | 
 | 
| 120 | 
  | 
  | 
 | 
| 121 | 
  | 
  | 
TString getEmiFile2(TString base, TString packetType, TString subType){ | 
| 122 | 
  | 
  | 
    Int_t debug = 0; | 
| 123 | 
  | 
  | 
    // | 
| 124 | 
  | 
  | 
    TString newfile; | 
| 125 | 
  | 
  | 
    stringcopy(newfile,base); | 
| 126 | 
  | 
  | 
    // | 
| 127 | 
  | 
  | 
    string fil = base; | 
| 128 | 
  | 
  | 
    Int_t posiz = fil.find("dw_"); | 
| 129 | 
  | 
  | 
    Int_t upper = 0; | 
| 130 | 
  | 
  | 
    if ( posiz == -1 ) { | 
| 131 | 
  | 
  | 
        posiz = fil.find("DW_"); | 
| 132 | 
  | 
  | 
        upper = 1; | 
| 133 | 
  | 
  | 
    }; | 
| 134 | 
  | 
  | 
    if ( posiz == -1 ) return "";     | 
| 135 | 
  | 
  | 
    TString fullname; | 
| 136 | 
  | 
  | 
    stringcopy(fullname,base,posiz,posiz+15); | 
| 137 | 
  | 
  | 
    stringappend(fullname,"."); | 
| 138 | 
  | 
  | 
    stringappend(fullname,packetType); | 
| 139 | 
  | 
  | 
    stringappend(fullname,"."); | 
| 140 | 
  | 
  | 
    stringappend(fullname,subType); | 
| 141 | 
  | 
  | 
    stringappend(fullname,".root"); | 
| 142 | 
  | 
  | 
    // | 
| 143 | 
  | 
  | 
    stringappend(newfile,"/"); | 
| 144 | 
  | 
  | 
    stringappend(newfile,packetType); | 
| 145 | 
  | 
  | 
    stringappend(newfile,"/"); | 
| 146 | 
  | 
  | 
    stringappend(newfile,fullname); | 
| 147 | 
  | 
  | 
    //    char *vediamo; | 
| 148 | 
  | 
  | 
    //vediamo = newfile; | 
| 149 | 
  | 
  | 
    //printf("filename: %s \n",vediamo); | 
| 150 | 
  | 
  | 
    //return; | 
| 151 | 
  | 
  | 
    TFile retfile(newfile); | 
| 152 | 
  | 
  | 
    if ( retfile.IsZombie() ) { | 
| 153 | 
  | 
  | 
        return "nofile";       | 
| 154 | 
  | 
  | 
    } else { | 
| 155 | 
  | 
  | 
        retfile.Close(); | 
| 156 | 
  | 
  | 
        return newfile;       | 
| 157 | 
  | 
  | 
    }; | 
| 158 | 
  | 
  | 
} | 
| 159 | 
  | 
  | 
 | 
| 160 | 
  | 
  | 
 | 
| 161 | 
  | 
  | 
 | 
| 162 | 
  | 
  | 
void RootTestE2(TString filename){ | 
| 163 | 
  | 
  | 
    Long64_t ntimes = 0; | 
| 164 | 
  | 
  | 
    Long64_t ncalibs = 0; | 
| 165 | 
  | 
  | 
    Int_t forever = 1; | 
| 166 | 
  | 
  | 
    while ( forever ){ | 
| 167 | 
  | 
  | 
        printf(" ntimes = %i\n",(int)ntimes); | 
| 168 | 
  | 
  | 
        TFile *calheadFile = 0; | 
| 169 | 
  | 
  | 
        calheadFile = getEmiFile(filename, "CalibCalPed","Header");     | 
| 170 | 
  | 
  | 
        TFile *calcalibFile = 0; | 
| 171 | 
  | 
  | 
        calcalibFile = getEmiFile(filename, "CalibCalPed");     | 
| 172 | 
  | 
  | 
        // | 
| 173 | 
  | 
  | 
        //gObjectTable->Print(); | 
| 174 | 
  | 
  | 
        // | 
| 175 | 
  | 
  | 
        if ( !calcalibFile || !calheadFile ) {       | 
| 176 | 
  | 
  | 
            printf(" -> not able to open file \n"); | 
| 177 | 
  | 
  | 
            if ( calheadFile ) calheadFile->Close(); | 
| 178 | 
  | 
  | 
            if ( calcalibFile ) calcalibFile->Close(); | 
| 179 | 
  | 
  | 
        } else { | 
| 180 | 
  | 
  | 
            TTree *tr = (TTree*)calheadFile->Get("Pscu"); | 
| 181 | 
  | 
  | 
            tr->AddFriend("CalibCalPed", calcalibFile); | 
| 182 | 
  | 
  | 
            //      pamela::calorimeter::CalibCalPedEvent *ce = 0; | 
| 183 | 
  | 
  | 
            pamela::CalibCalPedEvent *ce = 0; | 
| 184 | 
  | 
  | 
            pamela::PscuHeader *cph = 0; | 
| 185 | 
  | 
  | 
            pamela::EventHeader *ceh = 0; | 
| 186 | 
  | 
  | 
            tr->SetBranchAddress("Header", &ceh); | 
| 187 | 
  | 
  | 
            tr->SetBranchAddress("Event", &ce); | 
| 188 | 
  | 
  | 
            ncalibs    = tr->GetEntries(); | 
| 189 | 
  | 
  | 
            printf(" -> ncalibs = %i \n",(int)ncalibs); | 
| 190 | 
  | 
  | 
            calheadFile->Close(); | 
| 191 | 
  | 
  | 
            calcalibFile->Close();           | 
| 192 | 
  | 
  | 
        }; | 
| 193 | 
  | 
  | 
        ntimes++; | 
| 194 | 
  | 
  | 
    }; | 
| 195 | 
  | 
  | 
} | 
| 196 | 
  | 
  | 
 | 
| 197 | 
  | 
  | 
void trktesting(TString filename){     | 
| 198 | 
  | 
  | 
    TString startingdir = gSystem->WorkingDirectory(); | 
| 199 | 
  | 
  | 
    char *bdir; | 
| 200 | 
  | 
  | 
    char *sdir=gSystem->Getenv("PAM_LIB"); | 
| 201 | 
  | 
  | 
    bdir = Form("%s/liboptrklev1.so",sdir); | 
| 202 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 203 | 
  | 
  | 
    bdir = Form("%s/liboptrklev1_C.so",sdir); | 
| 204 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 205 | 
  | 
  | 
    bdir = Form("%s/libretrklev1.so",sdir); | 
| 206 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 207 | 
  | 
  | 
    bdir = Form("%s/libretrklev1_C.so",sdir); | 
| 208 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 209 | 
  | 
  | 
    bdir = Form("%s/libcltrklev1.so",sdir); | 
| 210 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 211 | 
  | 
  | 
    bdir = Form("%s/libcltrklev1_C.so",sdir); | 
| 212 | 
  | 
  | 
    gSystem->Load(bdir);    | 
| 213 | 
  | 
  | 
    Int_t trnev = 0; | 
| 214 | 
  | 
  | 
    struct Tracklev1 trklev1; | 
| 215 | 
  | 
  | 
    char *name; | 
| 216 | 
  | 
  | 
    name = filename; | 
| 217 | 
  | 
  | 
    //char *name2; | 
| 218 | 
  | 
  | 
    //name2 = filename; | 
| 219 | 
  | 
  | 
    ////    name = Form("%s",filename); | 
| 220 | 
  | 
  | 
    //name = name2; | 
| 221 | 
  | 
  | 
    //trnev = 123; | 
| 222 | 
  | 
  | 
    //printf("name = %s \n",name); | 
| 223 | 
  | 
  | 
    //printf("filename = %s \n",name2); | 
| 224 | 
  | 
  | 
    coptrklev1(name,trklev1,trnev); | 
| 225 | 
  | 
  | 
    //coptrklev1(); | 
| 226 | 
  | 
  | 
    printf("The tracker ntuple contains %i events\n",trnev); | 
| 227 | 
  | 
  | 
    for ( Int_t i = 1; i < trnev+1; i++){ | 
| 228 | 
  | 
  | 
        cretrklev1(i,trklev1); | 
| 229 | 
  | 
  | 
        printf("Event number %i ---> OBT %i \n",i,trklev1.obt1); | 
| 230 | 
  | 
  | 
        printf("                ---> PKTnum %i \n",trklev1.pkt_num1); | 
| 231 | 
  | 
  | 
        printf("                ---> PKTtype %x \n",trklev1.pkt_type1); | 
| 232 | 
  | 
  | 
        printf("                ---> nev1 %i \n",trklev1.nev1); | 
| 233 | 
  | 
  | 
        printf("                ---> good %i \n",trklev1.good1); | 
| 234 | 
  | 
  | 
        printf("                ---> nclstr %i \n",trklev1.nclstr1); | 
| 235 | 
  | 
  | 
    }; | 
| 236 | 
  | 
  | 
    ccltrklev1(trklev1);         | 
| 237 | 
  | 
  | 
    //ccltrklev1();  | 
| 238 | 
  | 
  | 
} | 
| 239 | 
  | 
  | 
 | 
| 240 | 
  | 
  | 
void trktesting2(TString filename){     | 
| 241 | 
  | 
  | 
    TString startingdir = gSystem->WorkingDirectory(); | 
| 242 | 
  | 
  | 
    char *bdir; | 
| 243 | 
  | 
  | 
    char *sdir; | 
| 244 | 
  | 
  | 
    sdir = startingdir; | 
| 245 | 
  | 
  | 
    bdir = Form("%s/tracker/liboptrklev2.so",sdir); | 
| 246 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 247 | 
  | 
  | 
    bdir = Form("%s/tracker/coptrklev2_C.so",sdir); | 
| 248 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 249 | 
  | 
  | 
    bdir = Form("%s/tracker/libretrklev2.so",sdir); | 
| 250 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 251 | 
  | 
  | 
    bdir = Form("%s/tracker/cretrklev2_C.so",sdir); | 
| 252 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 253 | 
  | 
  | 
    bdir = Form("%s/tracker/libcltrklev2.so",sdir); | 
| 254 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 255 | 
  | 
  | 
    bdir = Form("%s/tracker/ccltrklev2_C.so",sdir); | 
| 256 | 
  | 
  | 
    gSystem->Load(bdir); | 
| 257 | 
  | 
  | 
    Int_t trnev = 0; | 
| 258 | 
  | 
  | 
    struct Tracklev2 trklev2; | 
| 259 | 
  | 
  | 
    char *name; | 
| 260 | 
  | 
  | 
    name = filename; | 
| 261 | 
  | 
  | 
    coptrklev2(name,trklev2,trnev); | 
| 262 | 
  | 
  | 
    printf("The tracker ntuple contains %i events\n",trnev); | 
| 263 | 
  | 
  | 
    for ( Int_t i = 1; i < trnev+1; i++){ | 
| 264 | 
  | 
  | 
        cretrklev2(i,trklev2); | 
| 265 | 
  | 
  | 
        printf("Event number %i ---> OBT %i \n",i,trklev2.obt); | 
| 266 | 
  | 
  | 
        printf("                ---> PKTnum %i \n",trklev2.pkt_num); | 
| 267 | 
  | 
  | 
        printf("                ---> PKTtype %x \n",trklev2.pkt_type); | 
| 268 | 
  | 
  | 
        printf("                ---> nev2 %i \n",trklev2.nev2); | 
| 269 | 
  | 
  | 
        printf("                ---> good2 %i \n",trklev2.good2); | 
| 270 | 
  | 
  | 
        printf("                ---> ntrk %i \n",trklev2.ntrk); | 
| 271 | 
  | 
  | 
        if ( trklev2.ntrk == 1 && trklev2.al[0][4] != 0. ) printf("c-> RIG = %.9f \n",1./trklev2.al[0][4]); | 
| 272 | 
  | 
  | 
    }; | 
| 273 | 
  | 
  | 
    ccltrklev2(trklev2);         | 
| 274 | 
  | 
  | 
    //ccltrklev1();  | 
| 275 | 
  | 
  | 
} | 
| 276 | 
  | 
  | 
 | 
| 277 | 
  | 
  | 
void trkhtestlev2(TString filename){ | 
| 278 | 
  | 
  | 
    //    char *name; | 
| 279 | 
  | 
  | 
    //name = filename; | 
| 280 | 
  | 
  | 
    //char *nome; | 
| 281 | 
  | 
  | 
    //nome = Form("%s/Physics/Level1/",name); | 
| 282 | 
  | 
  | 
    //    TFile *f = new TFile(nome); | 
| 283 | 
  | 
  | 
    TFile *f = getFile(filename,"Physics.Level2","Tracker"); | 
| 284 | 
  | 
  | 
    TFile *caloFile; | 
| 285 | 
  | 
  | 
    caloFile = getFile(filename, "Physics.Level2", "Calorimeter"); | 
| 286 | 
  | 
  | 
    TTree *tr = (TTree*) f->Get("TrkLevel2"); | 
| 287 | 
  | 
  | 
    tr->AddFriend("CaloLevel2", caloFile); | 
| 288 | 
  | 
  | 
    struct Tracklev2 trk; | 
| 289 | 
  | 
  | 
    struct CTracklev2 track; | 
| 290 | 
  | 
  | 
    settrklev2(tr,trk); | 
| 291 | 
  | 
  | 
    Int_t nevents = tr->GetEntries();     | 
| 292 | 
  | 
  | 
    CalorimeterLevel2 *calo = new CalorimeterLevel2(); | 
| 293 | 
  | 
  | 
    tr->SetBranchAddress("CaloLevel2.Event",&calo); | 
| 294 | 
  | 
  | 
    for ( Int_t i = 0; i<nevents ; i++){ | 
| 295 | 
  | 
  | 
        tr->GetEntry(i); | 
| 296 | 
  | 
  | 
        accesstrklev2(trk,track); | 
| 297 | 
  | 
  | 
        printf("Event %i tracker OBT = %i \n",i,track.obt); | 
| 298 | 
  | 
  | 
        if ( track.ntrk>0 ) printf("Event %i tracker RIG = %f \n",i,1./track.al[4][0]); | 
| 299 | 
  | 
  | 
        //      Float_t obt = (float)trk.obt1; | 
| 300 | 
  | 
  | 
        //printf("Event %i tracker OBT1 = %f \n",i,obt); | 
| 301 | 
  | 
  | 
        printf("Event %i calo OBT = %i \n",i,calo->OBT); | 
| 302 | 
  | 
  | 
    }; | 
| 303 | 
  | 
  | 
} | 
| 304 | 
  | 
  | 
 | 
| 305 | 
  | 
  | 
void trkhtest(TString filename){ | 
| 306 | 
  | 
  | 
    //    char *name; | 
| 307 | 
  | 
  | 
    //name = filename; | 
| 308 | 
  | 
  | 
    //char *nome; | 
| 309 | 
  | 
  | 
    //nome = Form("%s/Physics/Level1/",name); | 
| 310 | 
  | 
  | 
    //    TFile *f = new TFile(nome); | 
| 311 | 
  | 
  | 
    TFile *f = getFile(filename,"Physics.Level1","Tracker"); | 
| 312 | 
  | 
  | 
    TFile *caloFile; | 
| 313 | 
  | 
  | 
    caloFile = getFile(filename, "Physics.Level2", "Calorimeter"); | 
| 314 | 
  | 
  | 
    TTree *tr = (TTree*) f->Get("TrkLevel1"); | 
| 315 | 
  | 
  | 
    tr->AddFriend("CaloLevel2", caloFile); | 
| 316 | 
  | 
  | 
    struct Tracklev1 trk; | 
| 317 | 
  | 
  | 
    struct CTracklev1 track; | 
| 318 | 
  | 
  | 
    settrklev1(tr,trk); | 
| 319 | 
  | 
  | 
    Int_t nevents = tr->GetEntries();     | 
| 320 | 
  | 
  | 
    CalorimeterLevel2 *calo = new CalorimeterLevel2(); | 
| 321 | 
  | 
  | 
    tr->SetBranchAddress("CaloLevel2.Event",&calo); | 
| 322 | 
  | 
  | 
    for ( Int_t i = 0; i<nevents ; i++){ | 
| 323 | 
  | 
  | 
        tr->GetEntry(i); | 
| 324 | 
  | 
  | 
        accesstrklev1(trk,track); | 
| 325 | 
  | 
  | 
        printf("Event %i tracker OBT1 = %i \n",i,track.obt1); | 
| 326 | 
  | 
  | 
        //      Float_t obt = (float)trk.obt1; | 
| 327 | 
  | 
  | 
        //printf("Event %i tracker OBT1 = %f \n",i,obt); | 
| 328 | 
  | 
  | 
        printf("Event %i calo OBT1 = %i \n",i,calo->OBT); | 
| 329 | 
  | 
  | 
    }; | 
| 330 | 
  | 
  | 
} | 
| 331 | 
  | 
  | 
 | 
| 332 | 
  | 
  | 
 | 
| 333 | 
  | 
  | 
void trkhtest2(TString filename){ | 
| 334 | 
  | 
  | 
    TFile *f = new TFile(filename); | 
| 335 | 
  | 
  | 
    TTree *tr = (TTree*) f->Get("TrkLevel1"); | 
| 336 | 
  | 
  | 
    TrackerLevel1 *trk = new TrackerLevel1(); | 
| 337 | 
  | 
  | 
    //struct Tracklev1 trk; | 
| 338 | 
  | 
  | 
    tr->SetBranchAddress("good1", &trk->good1);                 | 
| 339 | 
  | 
  | 
    tr->SetBranchAddress("obt1", &trk->obt1);                 | 
| 340 | 
  | 
  | 
    tr->SetBranchAddress("pkt_num1", &trk->pkt_num1);                 | 
| 341 | 
  | 
  | 
    //tr->SetBranchAddress("obt1", &trk.obt1);                 | 
| 342 | 
  | 
  | 
    Int_t nevents = tr->GetEntries();     | 
| 343 | 
  | 
  | 
    for ( Int_t i = 0; i<nevents ; i++){ | 
| 344 | 
  | 
  | 
        tr->GetEntry(i); | 
| 345 | 
  | 
  | 
        printf("Event %i GOOD1 = %i \n",i,trk->good1); | 
| 346 | 
  | 
  | 
        printf("Event %i PKT_NUM1 = %i \n",i,trk->pkt_num1); | 
| 347 | 
  | 
  | 
        printf("Event %i OBT1 = %i \n",i,trk->obt1); | 
| 348 | 
  | 
  | 
    }; | 
| 349 | 
  | 
  | 
} |