-//________________________________________________________________________
-void AliAlignmentDataFilterITS::ConnectInputData(Option_t *)
-{
- // Connect ESD
- // Called once
-
- TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
- if(!tree) {
- printf("ERROR: Could not read chain from input slot 0\n");
- } else {
- // Get the OCDB path and the list of OCDB objects used for reco
- TMap *cdbMap = (TMap*)(tree->GetTree()->GetUserInfo())->FindObject("cdbMap");
- TList *cdbList = (TList*)(tree->GetTree()->GetUserInfo())->FindObject("cdbList");
-
- //cdbList->Print();
- // write the list to the user info of the output tree
- if(!fspTree) {
- printf("ERROR: fspTree does not exist\n");
- } else {
- TMap *cdbMapCopy = new TMap(cdbMap->GetEntries());
- cdbMapCopy->SetOwner(1);
- cdbMapCopy->SetName("cdbMap");
- TIter iter1(cdbMap->GetTable());
-
- TPair* pair = 0;
- while((pair = dynamic_cast<TPair*> (iter1.Next()))){
- TObjString* keyStr = dynamic_cast<TObjString*> (pair->Key());
- TObjString* valStr = dynamic_cast<TObjString*> (pair->Value());
- cdbMapCopy->Add(new TObjString(keyStr->GetName()), new TObjString(valStr->GetName()));
- }
-
- TList *cdbListCopy = new TList();
- cdbListCopy->SetOwner(1);
- cdbListCopy->SetName("cdbList");
-
- TIter iter2(cdbList);
-
- TObjString* cdbEntry=0;
- while((cdbEntry =(TObjString*)(iter2.Next()))) {
- cdbListCopy->Add(new TObjString(*cdbEntry));
- }
- cdbListCopy->Print();
-
-
- fspTree->GetUserInfo()->Add(cdbMapCopy);
- fspTree->GetUserInfo()->Add(cdbListCopy);
- }
-
- // Disable all branches and enable only the needed ones
- tree->SetBranchStatus("fTriggerMask", 1);
- tree->SetBranchStatus("fSPDVertex*", 1);
- tree->SetBranchStatus("ESDfriend*", 1);
- tree->SetBranchAddress("ESDfriend.",&fESDfriend);
- tree->SetBranchStatus("fSPDMult*", 1);
-
- AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-
- if(!esdH) {
- printf("ERROR: Could not get ESDInputHandler\n");
- } else {
- fESD = esdH->GetEvent();
- }
- }
-
- return;
-}