928 |
*/ |
*/ |
929 |
Bool_t PamLevel2::CheckLevel2File(TString name){ |
Bool_t PamLevel2::CheckLevel2File(TString name){ |
930 |
|
|
931 |
Bool_t CAL__ok = false; |
Bool_t CAL__ok = false; |
932 |
Bool_t TRK__ok = false; |
Bool_t TRK__ok = false; |
933 |
Bool_t TRK_L1__ok = false; |
Bool_t TRK_L1__ok = false; |
934 |
Bool_t TRG__ok = false; |
Bool_t TRG__ok = false; |
935 |
Bool_t TOF__ok = false; |
Bool_t TOF__ok = false; |
936 |
Bool_t S4__ok = false; |
Bool_t S4__ok = false; |
937 |
Bool_t ND__ok = false; |
Bool_t ND__ok = false; |
938 |
Bool_t AC__ok = false; |
Bool_t AC__ok = false; |
939 |
Bool_t ORB__ok = false; |
Bool_t ORB__ok = false; |
940 |
|
|
941 |
Bool_t RUN__ok = false; |
Bool_t RUN__ok = false; |
942 |
|
|
943 |
// cout << "Checking file: "<<name<<endl; |
// cout << "Checking file: "<<name<<endl; |
944 |
TFile *f = new TFile(name.Data()); |
TFile *f = new TFile(name.Data()); |
945 |
if( !f || f->IsZombie() ){ |
if( !f || f->IsZombie() ){ |
946 |
cout << "File: "<< f->GetName() <<" discarded ---- Non valid root file"<< endl; return false; |
cout << "File: "<< f->GetName() <<" discarded ---- Non valid root file"<< endl; return false; |
947 |
} |
} |
948 |
// cout << "Get list of keys: "<<f<<endl; |
// cout << "Get list of keys: "<<f<<endl; |
949 |
TList *lk = f->GetListOfKeys(); |
TList *lk = f->GetListOfKeys(); |
950 |
// lk->Print(); |
lk->Print(); |
951 |
TIter next(lk); |
TIter next(lk); |
952 |
TKey *key =0; |
TKey *key =0; |
953 |
Int_t nev =0; |
Int_t nev =0; |
954 |
Int_t nev_previous =0; |
Int_t nev_previous =0; |
955 |
while( (key = (TKey*)next()) ){ |
while( (key = (TKey*)next()) ){ |
956 |
|
|
957 |
nev_previous = nev; |
// cout << key->GetName() << endl; |
958 |
nev = ((TTree*)f->Get(key->GetName()))->GetEntries(); |
// cout << " Get tree: " << f->Get(key->GetName())<<endl; |
959 |
if( key->GetClassName()=="TTree" && nev_previous && nev != nev_previous ){ |
// nev_previous = nev; |
960 |
cout << "File: "<< f->GetName() <<" discarded ---- "<< key->GetName() << " tree: n.entries does not match "<<nev<<" "<<nev_previous<< endl; |
// cout << " n.entries "<< nev <<endl; |
961 |
return false; |
// if( key->GetClassName()=="TTree" && nev_previous && nev != nev_previous ){ |
962 |
}; |
// nev = ((TTree*)f->Get(key->GetName()))->GetEntries(); |
963 |
|
// cout << "File: "<< f->GetName() <<" discarded ---- "<< key->GetName() << " tree: n.entries does not match "<<nev<<" "<<nev_previous<< endl; |
964 |
|
// return false; |
965 |
|
// }; |
966 |
|
|
967 |
if( !strcmp(key->GetName(),"Calorimeter") )CAL__ok = true; |
if( !strcmp(key->GetName(),"Calorimeter") )CAL__ok = true; |
968 |
if( !strcmp(key->GetName(),"Trigger" ) )TRG__ok = true; |
if( !strcmp(key->GetName(),"Trigger" ) )TRG__ok = true; |