+ //Creating Branches for SDigits
+ if (TreeS() && cS ) {
+ // one branch for Sdigits per chamber
+ if (fSDigits == 0x0) {
+ fSDigits = new TObjArray(AliMUONConstants::NCh());
+ for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
+ TClonesArray * tca = new TClonesArray("AliMUONDigit",10000);
+ tca->SetOwner();
+ fSDigits->AddAt(tca,iDetectionPlane);
+ }
+ }
+ if (fNSdigits == 0x0) {
+ fNSdigits = new Int_t[AliMUONConstants::NCh()];
+ for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
+ fNSdigits[iDetectionPlane]=0;
+ }
+ }
+ for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
+ sprintf(branchname,"%sSDigits%d",GetName(),iDetectionPlane+1);
+ branch = 0x0;
+ branch = TreeS()->GetBranch(branchname);
+ if (branch) {
+ Info("MakeBranch","Branch %s is already in tree.",GetName());
+ return;
+ }
+ TClonesArray * Sdigits = SDigits(iDetectionPlane);
+ branch = TreeS()->Branch(branchname, &Sdigits, kBufferSize,1);
+ //Info("MakeBranch","Making Branch %s for Sdigits in detection plane %d\n",branchname,iDetectionPlane+1);
+ }
+ }
+