/*
$Log$
+Revision 1.3.6.1 2002/07/24 10:08:13 alibrary
+Updating VirtualMC
+
+Revision 1.4 2002/07/10 15:06:22 morsch
+Initialize TVector* save.
+
+Revision 1.3 2002/02/26 16:13:07 morsch
+Correction in streamer.
+
+Revision 1.2 2002/02/22 14:00:20 morsch
+Protection against replication of fieldmap data in gAlice.
+
+Revision 1.1 2002/02/14 11:41:28 morsch
+Magnetic field map for ALICE for L3+muon spectrometer stored in 3 seperate
+root files.
+
*/
//
// Standard constructor
//
fB = 0;
+ SetWriteEnable();
}
AliFieldMap::AliFieldMap(const char *name, const char *title)
//
fB = 0;
ReadField();
+ SetWriteEnable();
}
AliFieldMap::~AliFieldMap()
// Method to read the magnetic field map from file
//
FILE* magfile;
- FILE* endf = fopen("end.table", "r");
- FILE* out = fopen("out", "w");
+// FILE* endf = fopen("end.table", "r");
+// FILE* out = fopen("out", "w");
Int_t ix, iy, iz, ipx, ipy, ipz;
Float_t bx, by, bz;
for (iz = 0; iz < fZn; iz++) {
ipz=ipy+iz*3;
- if (iz == -1)
- fscanf(endf,"%f %f %f", &bx,&by,&bz);
- else if (iz > -1)
+ if (iz == -1) {
+// fscanf(endf,"%f %f %f", &bx,&by,&bz);
+ } else if (iz > -1) {
fscanf(magfile," %f %f %f", &bx, &by, &bz);
- else
+ } else {
continue;
-
+ }
+
// fscanf(magfile,"%f %f %f %f %f %f %f ",
// &x, &y, &z, &bx,&by,&bz, &b);
// fprintf(out, "%15.8e %15.8e %15.8e \n", bx, by, bz);
magf.Copy(*this);
return *this;
}
+
+void AliFieldMap::Streamer(TBuffer &R__b)
+{
+ // Stream an object of class AliFieldMap.
+ TVector* save = 0;
+
+ if (R__b.IsReading()) {
+ AliFieldMap::Class()->ReadBuffer(R__b, this);
+ } else {
+ if (!fWriteEnable) {
+ save = fB;
+ fB = 0;
+ }
+ AliFieldMap::Class()->WriteBuffer(R__b, this);
+ if (!fWriteEnable) fB = save;
+ }
+}