- while (input.Next()) {
-
- Int_t det = input.GetDetector();
- Int_t npads = input.GetNPads();
-
- if (input.IsNewDetector()) {
-
- if (digits) digits->Compress(1,0);
-
- if (fDebug > 2) {
- Info("Raw2Digits","Subevent header:");
- Info("Raw2Digits","\tdet = %d",det);
- Info("Raw2Digits","\tnpads = %d",npads);
- }
-
- // Create the data buffer
- Int_t cham = geo->GetChamber(det);
- Int_t plan = geo->GetPlane(det);
- Int_t sect = geo->GetSector(det);
- Int_t rowMax = par->GetRowMax(plan,cham,sect);
- Int_t colMax = par->GetColMax(plan);
- Int_t timeMax = par->GetTimeMax();
-
- // Add a container for the digits of this detector
- digits = digitsManager->GetDigits(det);
- // Allocate memory space for the digits buffer
- if (digits->GetNtime() == 0) {
- digits->Allocate(rowMax,colMax,timeMax);
- }
+ Int_t lastdet = -1;
+ Int_t det = 0;
+ Int_t it = 0;
+ while (input.Next())
+ {
+
+ det = input.GetDet();
+
+ if (det != lastdet)
+ {
+
+ lastdet = det;
+
+ if (digits) digits->Compress(1,0);
+ if (track0) track0->Compress(1,0);
+ if (track1) track1->Compress(1,0);
+ if (track2) track2->Compress(1,0);
+
+ // Add a container for the digits of this detector
+ digits = digitsManager->GetDigits(det);
+ track0 = digitsManager->GetDictionary(det,0);
+ track1 = digitsManager->GetDictionary(det,1);
+ track2 = digitsManager->GetDictionary(det,2);
+
+ // Allocate memory space for the digits buffer
+ if (digits->GetNtime() == 0)
+ {
+ digits->Allocate(input.GetMaxRow(),input.GetMaxCol(), input.GetNumberOfTimeBins());
+ track0->Allocate(input.GetMaxRow(),input.GetMaxCol(), input.GetNumberOfTimeBins());
+ track1->Allocate(input.GetMaxRow(),input.GetMaxCol(), input.GetNumberOfTimeBins());
+ track2->Allocate(input.GetMaxRow(),input.GetMaxCol(), input.GetNumberOfTimeBins());
+ }
+ }
+
+ for (it = 0; it < 3; it++)
+ {
+ if ( input.GetTimeBin() + it < input.GetNumberOfTimeBins() )
+ {
+ digits->SetDataUnchecked(input.GetRow(), input.GetCol(),
+ input.GetTimeBin() + it, input.GetSignals()[it]);
+ track0->SetDataUnchecked(input.GetRow(), input.GetCol(),
+ input.GetTimeBin() + it, 0);
+ track1->SetDataUnchecked(input.GetRow(), input.GetCol(),
+ input.GetTimeBin() + it, 0);
+ track2->SetDataUnchecked(input.GetRow(), input.GetCol(),
+ input.GetTimeBin() + it, 0);