3 #include "TObjString.h"
10 void DisableBranches(TTree* tree)
12 TObjArray* list = tree->GetListOfLeaves();
16 TObjArray branchesToKeep;
17 branchesToKeep.SetOwner(kTRUE);
19 branchesToKeep.Add(new TObjString("rawevent"));
20 branchesToKeep.Add(new TObjString("MUON"));
21 branchesToKeep.Add(new TObjString("Common"));
22 branchesToKeep.Add(new TObjString("TRG"));
23 branchesToKeep.Add(new TObjString("T0"));
24 branchesToKeep.Add(new TObjString("VZERO"));
25 branchesToKeep.Add(new TObjString("ZDC"));
26 branchesToKeep.Add(new TObjString("ITSSPD"));
28 TIter nit(&branchesToKeep);
30 tree->SetBranchStatus("*",0);
34 while ( ( leaf = static_cast<TLeaf*>(next()) ) )
36 TString name(leaf->GetName());
37 if (!name.BeginsWith("f") && name != "rawevent" )
45 while ( ( str = static_cast<TObjString*>(nit()) ) )
47 if ( name.BeginsWith(str->String()) )
55 leaf->GetBranch()->SetStatus(1);
60 int FILTER_RAWMUON(const char* from, const char* to)
62 TString sinputfile(from);
64 if (sinputfile.BeginsWith("alien://"))
68 TGrid::Connect("alien://");
72 Error("FILTER_RAWMUON","Cannot connect to Grid !");
77 TFile* rawFile = TFile::Open(from);
79 TTree *rawTree=(TTree *)rawFile->Get("RAW");
82 Error("FILTER_RAWMUON","Error getting RAW tree from file %s",from);
88 DisableBranches(rawTree);
90 TFile* newfile = new TFile(snewfile.Data(),"recreate");
92 TTree* newTree = rawTree->CloneTree();