+ branch = TreeD()->GetBranch(branchname);
+ TClonesArray * digits = Digits(i);
+ if (branch) {
+ branch->SetAddress( &digits );
+ }
+ else AliWarning(Form("(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i));
+ }
+ }
+ }
+ if ( TreeD() && fLocalTrigger && cGLT) {
+ sprintf(branchname,"%sLocalTrigger",GetName());
+ branch = TreeD()->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fLocalTrigger);
+ else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName()));
+ }
+ if ( TreeD() && fRegionalTrigger && cGLT) {
+ sprintf(branchname,"%sRegionalTrigger",GetName());
+ branch = TreeD()->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fRegionalTrigger);
+ else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeD.",GetName()));
+ }
+ if ( TreeD() && fGlobalTrigger && cGLT) {
+ sprintf(branchname,"%sGlobalTrigger",GetName());
+ branch = TreeD()->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fGlobalTrigger);
+ else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName()));
+ }
+
+ //
+ // Branch address for Sdigit tree
+ if ( TreeS() && cS)
+ {
+ if (fSDigits == 0x0)
+ {
+ AliDebug(1,"Creating fSDigits TObjArray");
+ fSDigits = new TObjArray(AliMUONConstants::NCh());
+ fNSdigits= new Int_t[AliMUONConstants::NCh()];
+ for (Int_t i=0; i<AliMUONConstants::NCh() ;i++)
+ {
+ TClonesArray* a = new TClonesArray("AliMUONDigit",10000);
+ fSDigits->AddAt(a,i);
+ AliDebug(1,Form("fSDigits[%d]=%p",i,a));
+ fNSdigits[i]=0;
+ }
+ }
+ else
+ {
+ AliDebug(1,Form("fSDigits already there = %p",fSDigits));
+ }
+ }
+
+ if (TreeS() && fSDigits && cS) {
+ AliDebug(1,"Setting branch addresses");
+ for (int i=0; i<AliMUONConstants::NCh(); i++) {
+ sprintf(branchname,"%sSDigits%d",GetName(),i+1);
+ if (fSDigits) {
+ AliDebug(1,Form("TreeS=%p for ich=%d branchname=%s",
+ TreeS(),i,branchname));
+ branch = TreeS()->GetBranch(branchname);
+ TClonesArray * sdigits = SDigits(i);
+ if (branch) branch->SetAddress( &sdigits );
+ else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));