Changeset 2133 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 05/22/03 18:27:22 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r2128 r2133 1083 1083 return i!=0; 1084 1084 } 1085 1086 // -------------------------------------------------------------------------- 1087 // 1088 // ShuffleEvents. Shuffles the order of the matrix rows. 1089 // 1090 // 1091 void MHMatrix::ShuffleRows(UInt_t seed) 1092 { 1093 TRandom rnd(seed); 1094 1095 for (Int_t irow = 0; irow < fNumRow; irow++) 1096 { 1097 Int_t jrow = rnd.Integer(fNumRow); 1098 1099 for (Int_t icol = 0; icol < fM.GetNcols(); icol++) 1100 { 1101 Real_t tmp = fM(irow,icol); 1102 fM(irow,icol) = fM(jrow,icol); 1103 fM(jrow,icol) = tmp; 1104 } 1105 } 1106 1107 *fLog << warn << this->GetName() << " : Attention! Matrix rows have been shuffled." << endl; 1108 1109 } -
trunk/MagicSoft/Mars/mhist/MHMatrix.h
r2043 r2133 112 112 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 113 113 114 void ShuffleRows(UInt_t seed); 115 114 116 ClassDef(MHMatrix, 1) // Multidimensional Matrix to store events 115 117 };
Note:
See TracChangeset
for help on using the changeset viewer.