diff --git a/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.cxx b/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.cxx
index 2a3fe7bf84a36dc804a48802543ecf684012167b..88fc152d23cf293338054124691d80dd92d74de6 100644
--- a/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.cxx
+++ b/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.cxx
@@ -81,7 +81,7 @@ void TComptonTelescopePhysics::BuildPhysicalEvent()
 void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
 {
   //cout << "\nBegin event treatment" << endl;
-  m_CounterEvt[0] = 1; // total nb of events
+  //m_CounterEvt[0] = 1; // total nb of events
 
   // select active channels and apply threhsolds
   PreTreat();
@@ -93,7 +93,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
   //cout << "event type = " << evtType << endl;
  
   // check possible interstrip
-  if (evtType == 2) {
+/*  if (evtType == 2) {
     if (m_PreTreatedData->GetCTTrackerFrontEMult() == 2 && m_PreTreatedData->GetCTTrackerBackEMult() == 1 || m_PreTreatedData->GetCTTrackerFrontEMult() == 1 && m_PreTreatedData->GetCTTrackerBackEMult() == 2) {
       //cout << "event type 2 possible interstrip" << endl;
       m_CounterEvt[21] = 1; // possible interstrip mult 2-1
@@ -119,6 +119,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
       }
     }
   }
+*/
 
   // Remove: do general case
   //if (CheckEvent() == 1) {   // case where multiplicity front = multiplicity back
@@ -130,8 +131,8 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
   // keep only mult 1 couples
   //if (couple.size() ==  1) { // pb if done here, so done in Match_Front_Back()
   for (UShort_t i = 0; i < couple.size(); ++i) { // loop on selected events
-    m_CounterEvt[16] = 1; // nb of physics events
-    m_CounterHit[10] += 1; // nb of physics hits
+    //m_CounterEvt[16] = 1; // nb of physics events
+    //m_CounterHit[10] += 1; // nb of physics hits
 
     // Energy
     Int_t Tower = m_PreTreatedData->GetCTTrackerFrontETowerNbr(couple[i].X());
@@ -143,7 +144,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
 
     //cout << "mult " << couple.size() << " event type " << evtType << endl;
     // Event type
-    if (evtType == 1) {
+/*    if (evtType == 1) {
       m_CounterEvt[17] = 1; // nb of physics events with mult F = mult B
       //cout << "event type 1: couple size " << couple.size() << " couple " <<i << " SF" << Front << " SB" << Back << " EF " << Front_E << " EB " << Back_E << endl;
     }
@@ -154,6 +155,7 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
       }
     }
     if (evtType == -1) m_CounterEvt[19] = 1; // nb of physics events with mult F != mult B or mult B +- 1
+*/
 
     // Time
     // Front
@@ -161,8 +163,8 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
     Double_t Front_T = -1000.;
     for (UShort_t t = 0; t < m_PreTreatedData->GetCTTrackerFrontTMult(); t++) {
       if (m_PreTreatedData->GetCTTrackerFrontETowerNbr(couple[i].X()) == m_PreTreatedData->GetCTTrackerFrontTTowerNbr(t) && m_PreTreatedData->GetCTTrackerFrontEDetectorNbr(couple[i].X()) == m_PreTreatedData->GetCTTrackerFrontTDetectorNbr(t)) {
-        m_CounterEvt[42] = 1; // nb of physics events with front time
-        m_CounterHit[42] += 1; // nb of physics hits with front time
+        //m_CounterEvt[42] = 1; // nb of physics events with front time
+        //m_CounterHit[42] += 1; // nb of physics hits with front time
         Front_T = m_PreTreatedData->GetCTTrackerFrontTTime(t);
         //cout << "Time F: Tower" << m_PreTreatedData->GetCTTrackerFrontTTowerNbr(t) << " D" << m_PreTreatedData->GetCTTrackerFrontTDetectorNbr(t) << " T = " << Front_T << endl;
       }
@@ -172,21 +174,21 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
     Double_t Back_T = -1000;
     for (UShort_t t = 0; t < m_PreTreatedData->GetCTTrackerBackTMult(); t++) {
       if (m_PreTreatedData->GetCTTrackerBackETowerNbr(couple[i].Y()) == m_PreTreatedData->GetCTTrackerBackTTowerNbr(t) && m_PreTreatedData->GetCTTrackerBackEDetectorNbr(couple[i].Y()) == m_PreTreatedData->GetCTTrackerBackTDetectorNbr(t)) {
-        m_CounterEvt[43] = 1; // nb of physics events with back time
-        m_CounterHit[43] += 1; // nb of physics hits with back time
+        //m_CounterEvt[43] = 1; // nb of physics events with back time
+        //m_CounterHit[43] += 1; // nb of physics hits with back time
         Back_T = m_PreTreatedData->GetCTTrackerBackTTime(t);
         //cout << "Time B: Tower" << m_PreTreatedData->GetCTTrackerBackTTowerNbr(t) << " D" << m_PreTreatedData->GetCTTrackerBackTDetectorNbr(t) << " T = " << Back_T << endl;
       }
     }
     // check time
-    bool Same_T = false;
+/*    bool Same_T = false;
     if (Front_T == Back_T) {
       //cout << "same T" << endl;
       Same_T = true;
       m_CounterEvt[44] = 1; // nb of physics events with same FB time
       m_CounterHit[44] += 1; // nb of physics hits with same FB time
     }
-
+*/
     //cout << "couple " << i << " CT" << Tower << " D" << N << " SF" << Front << " SB" << Back << " EF " << Front_E << " EB " << Back_E << " TF " << Front_T << " TB " << Back_T << endl;
 
     // Fill TComptonTelescopePhysics members
@@ -200,13 +202,13 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
     Half_Energy.push_back((Front_E+Back_E)/2);
     Front_Time.push_back(Front_T);
     Back_Time.push_back(Back_T);
-    Same_FBTime.push_back(Same_T);
+    //Same_FBTime.push_back(Same_T);
 
-    if (m_Take_E_Front)
+/*    if (m_Take_E_Front)
       Strip_E.push_back(Front_E);
     else
       Strip_E.push_back(Back_E);
-
+*/
     //}
   }
 //  } // end check event
@@ -218,6 +220,8 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
 /*  double charge = 0;
   unsigned int maxIndex = 0;
   int max = 0;*/
+  double sumADC = 0;
+  double E_calib = 0;
   unsigned int cursor = 0;
   UShort_t detectorNumber = 0;
   for (int j = 0; j < nCalorTriggered; j++) {
@@ -238,9 +242,14 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
     vector<int> data;
     data.clear();
     data.resize(m_NPixels, 0);
+    vector<int> data_align; // for online analysis
+    data_align.clear();
+    data_align.resize(m_NPixels, 0);
     for (int i = 0; i < m_NPixels; i++) {
       if (m_PreTreatedData->GetCTCalorimeterEChannelNbr(i+cursor) == i) {
         data[i] = m_PreTreatedData->GetCTCalorimeterEEnergy(i+cursor);
+        data_align[i] = fCalorimeter_coeffAlign(m_PreTreatedData, i+cursor);
+        //cout << "data pretreat " << data[i] << " ; align " << data_align[i] << endl;
       } else {
         cout << "Inconsistency found in channel ordering while filling CalorData: field #" << cursor+i << endl;
       }
@@ -263,6 +272,17 @@ void TComptonTelescopePhysics::BuildSimplePhysicalEvent()
     Calor_E.push_back(accumulate(data.begin(), data.end(), 0));// Uncorrected uncalibrated energy
   
     Calor_T.push_back(m_PreTreatedData->GetCTCalorimeterTTime(j));
+
+    // for online analysis: calibrated energy
+    sumADC = accumulate(data_align.begin(), data_align.end(), 0);
+    //cout << "sum ADC " << accumulate(data.begin(), data.end(), 0) << " align " << sumADC << endl;
+
+    E_calib = 0;
+    E_calib = fCalorimeter_calibE(sumADC, detectorNumber);
+    Calor_E_calib.push_back(E_calib);
+    //cout << "det " << detectorNumber << " E " << E_calib << endl;
+    
+
   }//End of loop on triggered calorimeter detectors
 
   /// Delta T analysis ///
@@ -288,20 +308,20 @@ void TComptonTelescopePhysics::PreTreat()
 
   // Front, energy
   for (UShort_t i = 0; i < m_EventData->GetCTTrackerFrontEMult(); ++i) {
-    m_CounterEvt[1] = 1; // nb of events with at least one EF raw recorded
-    m_CounterHit[0] += 1; // nb of hits with EF raw
+    //m_CounterEvt[1] = 1; // nb of events with at least one EF raw recorded
+    //m_CounterHit[0] += 1; // nb of hits with EF raw
     //cout << "Raw: DetF = " << m_EventData->GetCTTrackerFrontEDetectorNbr(i) << " ; stripF = " << m_EventData->GetCTTrackerFrontEStripNbr(i) << " ; EF raw = " << m_EventData->GetCTTrackerFrontEEnergy(i) << endl;
 
     if (m_EventData->GetCTTrackerFrontEEnergy(i) > m_StripFront_E_RAW_Threshold &&
         IsValidChannel("Front", m_EventData->GetCTTrackerFrontEDetectorNbr(i), m_EventData->GetCTTrackerFrontEStripNbr(i))) {     
-      m_CounterEvt[2] = 1; // nb of events with at least one EF raw > threshold
-      m_CounterHit[1] += 1; // nb of hits with EF raw > threshold
-      Double_t E = fStrip_Front_E(m_EventData, i);//Calibration happens here
+      //m_CounterEvt[2] = 1; // nb of events with at least one EF raw > threshold
+      //m_CounterHit[1] += 1; // nb of hits with EF raw > threshold
+      Double_t E = fStrip_Front_E(m_EventData, i)*1e3;//Calibration happens here, E in keV
       
       if (E > m_StripFront_E_Threshold) {
         //cout << "CalF: Det = " << m_EventData->GetCTTrackerFrontEDetectorNbr(i) << " ; strip = " << m_EventData->GetCTTrackerFrontEStripNbr(i) << " ; E cal = " << E << endl;
-        m_CounterEvt[3] = 1; // nb of events with at least one EF cal > threshold
-        m_CounterHit[2] += 1; // nb of hits with EF cal > threshold
+        //m_CounterEvt[3] = 1; // nb of events with at least one EF cal > threshold
+        //m_CounterHit[2] += 1; // nb of hits with EF cal > threshold
         m_PreTreatedData->SetFrontE(
             m_EventData->GetCTTrackerFrontETowerNbr(i),
             m_EventData->GetCTTrackerFrontEDetectorNbr(i),
@@ -313,20 +333,20 @@ void TComptonTelescopePhysics::PreTreat()
 
   // Back, energy
   for (UShort_t i = 0; i < m_EventData->GetCTTrackerBackEMult(); ++i) {
-    m_CounterEvt[4] = 1; // nb of events with at least one EB raw recorded
-    m_CounterHit[3] += 1; // nb of hits with EB raw
+    //m_CounterEvt[4] = 1; // nb of events with at least one EB raw recorded
+    //m_CounterHit[3] += 1; // nb of hits with EB raw
     //cout << "Raw: DetB = " << m_EventData->GetCTTrackerBackEDetectorNbr(i) << " ; stripB = " << m_EventData->GetCTTrackerBackEStripNbr(i) << " ; EB raw = " << m_EventData->GetCTTrackerBackEEnergy(i) << endl;
 
     if (m_EventData->GetCTTrackerBackEEnergy(i) > m_StripBack_E_RAW_Threshold && 
         IsValidChannel("Back", m_EventData->GetCTTrackerBackEDetectorNbr(i), m_EventData->GetCTTrackerBackEStripNbr(i))) {
-      m_CounterEvt[5] = 1; // nb of events with at least one EB raw > threshold
-      m_CounterHit[4] += 1; // nb of hits with EB raw > threshold
-      Double_t E = fStrip_Back_E(m_EventData, i);//Calibration happens here
+      //m_CounterEvt[5] = 1; // nb of events with at least one EB raw > threshold
+      //m_CounterHit[4] += 1; // nb of hits with EB raw > threshold
+      Double_t E = fStrip_Back_E(m_EventData, i)*1e3;//Calibration happens here, E in keV
 
       if (E > m_StripBack_E_Threshold) {
         //cout << "CalB: Det = " << m_EventData->GetCTTrackerBackEDetectorNbr(i) << " ; stripB = " << m_EventData->GetCTTrackerBackEStripNbr(i) << " ; EB cal = " << E << endl;
-        m_CounterEvt[6] = 1; // nb of events with at least one EB cal > threshold
-        m_CounterHit[5] += 1; // nb of hits with EB cal > threshold
+        //m_CounterEvt[6] = 1; // nb of events with at least one EB cal > threshold
+        //m_CounterHit[5] += 1; // nb of hits with EB cal > threshold
         m_PreTreatedData->SetBackE(
             m_EventData->GetCTTrackerBackETowerNbr(i),
             m_EventData->GetCTTrackerBackEDetectorNbr(i),
@@ -339,8 +359,8 @@ void TComptonTelescopePhysics::PreTreat()
   // DSSSD time information and calorimeter still have to be done...
   // Front, time
   for (UShort_t i = 0; i < m_EventData->GetCTTrackerFrontTMult(); ++i) {
-    m_CounterEvt[40] = 1; // nb of events with FT
-    m_CounterHit[40] += 1; // nb of hits with FT
+    //m_CounterEvt[40] = 1; // nb of events with FT
+    //m_CounterHit[40] += 1; // nb of hits with FT
     m_PreTreatedData->SetFrontT(
         m_EventData->GetCTTrackerFrontTTowerNbr(i),
         m_EventData->GetCTTrackerFrontTDetectorNbr(i),
@@ -351,8 +371,8 @@ void TComptonTelescopePhysics::PreTreat()
 
   // Back, time
   for (UShort_t i = 0; i < m_EventData->GetCTTrackerBackTMult(); ++i) {
-    m_CounterEvt[41] = 1; // nb of events with BT
-    m_CounterHit[41] += 1; // nb of hits with BT
+    //m_CounterEvt[41] = 1; // nb of events with BT
+    //m_CounterHit[41] += 1; // nb of hits with BT
     m_PreTreatedData->SetBackT(
         m_EventData->GetCTTrackerBackTTowerNbr(i),
         m_EventData->GetCTTrackerBackTDetectorNbr(i),
@@ -364,15 +384,17 @@ void TComptonTelescopePhysics::PreTreat()
 
   // Calorimeter
   int data[m_NPixels];
+  //cout << "mult calo " << m_EventData->GetCTCalorimeterTMult() << endl;
   for (UShort_t i = 0; i < m_EventData->GetCTCalorimeterTMult(); ++i) {
     for (int j = 0; j < m_NPixels; j++) {
+      //cout << "data " << m_EventData->GetCTCalorimeterEEnergy(j) << endl;
       data[j] = fCalorimeter_ped(m_EventData, i*m_NPixels+j);
+      //cout << "data - ped " << data[j] << endl;
     }
     m_PreTreatedData -> SetCTCalorimeter(m_EventData->GetCTCalorimeterTTowerNbr(i), m_EventData->GetCTCalorimeterEDetectorNbr(i*m_NPixels), m_EventData->GetCTCalorimeterTChannelNbr(i), m_EventData->GetCTCalorimeterTTime(i), data, m_NPixels);
   }
 
   m_PreTreatedData -> SetResetCount(m_EventData -> GetResetCount());
-
 }
 
 
@@ -384,19 +406,19 @@ int TComptonTelescopePhysics::CheckEvent()
   // same multiplicity on front and back side 
   if (m_PreTreatedData->GetCTTrackerBackEMult() == m_PreTreatedData->GetCTTrackerFrontEMult()) {
     //cout << "mult event type 1 = " << m_PreTreatedData->GetCTTrackerBackEMult() << endl;
-    m_CounterEvt[8] = 1; // nb of pretreated events with mult F = mult B
+    //m_CounterEvt[8] = 1; // nb of pretreated events with mult F = mult B
     return 1 ; // Regular Event
   }
 
   // possibly interstrip
   else if (m_PreTreatedData->GetCTTrackerFrontEMult() == m_PreTreatedData->GetCTTrackerBackEMult()+1 || 
       m_PreTreatedData->GetCTTrackerFrontEMult() == m_PreTreatedData->GetCTTrackerBackEMult()-1) {
-    m_CounterEvt[9] = 1; // nb of pretreated events with mult F = mult B +- 1
+    //m_CounterEvt[9] = 1; // nb of pretreated events with mult F = mult B +- 1
     return 2;
   }
 
   else {
-    m_CounterEvt[10] = 1; // nb of pretreated events with mult F != mult B or mult B +- 1
+    //m_CounterEvt[10] = 1; // nb of pretreated events with mult F != mult B or mult B +- 1
     return -1 ; // Rejected Event
   }
 }
@@ -421,13 +443,13 @@ vector<TVector2> TComptonTelescopePhysics::Match_Front_Back()
       // if same tower and same detector check energy
       if ((m_PreTreatedData->GetCTTrackerFrontETowerNbr(i) == m_PreTreatedData->GetCTTrackerBackETowerNbr(j)) && 
           (m_PreTreatedData->GetCTTrackerFrontEDetectorNbr(i) == m_PreTreatedData->GetCTTrackerBackEDetectorNbr(j))) {
-        m_CounterEvt[12] = 1; // nb of pretreated events with EF and EB in same tower and detector
-        m_CounterHit[7] += 1; // nb of hits with EF and EB in same tower and detector
+        //m_CounterEvt[12] = 1; // nb of pretreated events with EF and EB in same tower and detector
+        //m_CounterHit[7] += 1; // nb of hits with EF and EB in same tower and detector
         
         // equal energy
         if (abs((m_PreTreatedData->GetCTTrackerFrontEEnergy(i) - m_PreTreatedData->GetCTTrackerBackEEnergy(j))/2.) < m_StripEnergyMatchingNumberOfSigma*m_StripEnergyMatchingSigma) {
-          m_CounterEvt[13] = 1; // nb of pretreated events with same D and E
-          m_CounterHit[8] += 1; // nb of hits with same D and E
+          //m_CounterEvt[13] = 1; // nb of pretreated events with same D and E
+          //m_CounterHit[8] += 1; // nb of hits with same D and E
           ArrayOfGoodCouple.push_back(TVector2(i,j));
         } // end test energy
 
@@ -452,14 +474,14 @@ vector<TVector2> TComptonTelescopePhysics::Match_Front_Back()
   // prevent treating event with ambiguous matching beetween X and Y
   // not done
   if (ArrayOfGoodCouple.size() > m_PreTreatedData->GetCTTrackerFrontEMult()) {
-    m_CounterEvt[14] = 1; // nb of pretreated events with ambiguous matching
+    //m_CounterEvt[14] = 1; // nb of pretreated events with ambiguous matching
     //ArrayOfGoodCouple.clear();
   }
 
   // keep only mult = 1
   if (m_MultOneOnly) {
     if (ArrayOfGoodCouple.size() > 1) {
-      m_CounterEvt[15] = 1; // nb of events with couple size > 1
+      //m_CounterEvt[15] = 1; // nb of events with couple size > 1
       ArrayOfGoodCouple.clear();
     }
   }
@@ -642,14 +664,14 @@ void TComptonTelescopePhysics::Clear()
   DetectorNumber.clear();
   Strip_Front.clear();
   Strip_Back.clear();
-  Strip_E.clear();
+  //Strip_E.clear();
   Strip_T.clear();
   Front_Energy.clear();
   Back_Energy.clear();
   Half_Energy.clear();
   Front_Time.clear();
   Back_Time.clear();
-  Same_FBTime.clear();
+  //Same_FBTime.clear();
 
   // counters
   for (Int_t i = 0; i < m_nCounterEvt; i++) m_CounterEvt[i] = 0;
@@ -657,6 +679,7 @@ void TComptonTelescopePhysics::Clear()
 
   // Calorimeter
   Calor_E.clear();
+  Calor_E_calib.clear();
   Calor_T.clear();
   CalorPosX.clear();
   CalorPosY.clear();
@@ -674,7 +697,42 @@ void TComptonTelescopePhysics::Clear()
 ///////////////////////////////////////////////////////////////////////////
 void TComptonTelescopePhysics::ReadConfiguration(NPL::InputParser parser){
 
-  // DSSSD blocks
+  vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("ComptonTelescope");
+  if(NPOptionManager::getInstance()->GetVerboseLevel())
+    cout << "//// " << blocks.size() << " detectors found " << endl; 
+
+  vector<string> token = {"SIZE_DSSSD", "THICKNESS_DSSSD", "NUMBER_STRIPS", "X0_Y0", "X31_Y0", "X0_Y31", "X31_Y31", "NUMBER_DSSSD","DISTANCE_INTER_DSSSD", "DISTANCE_TRACKER_CALORIMETER", "THICKNESS_CALORIMETER", "NPIXELS_CALORIMETER", "TRACKER","CALORIMETER","VIS"};
+
+  for(unsigned int i = 0 ; i < blocks.size() ; i++){
+    if(blocks[i]->HasTokenList(token)){      
+      double     size = blocks[i]->GetDouble("SIZE_DSSSD","mm");
+      double thickness = blocks[i]->GetDouble("THICKNESS_DSSSD","mm");
+      int    nbr_strip = blocks[i]->GetInt("NUMBER_STRIPS");
+      TVector3 A = blocks[i]->GetTVector3("X0_Y0", "mm");
+      TVector3 B = blocks[i]->GetTVector3("X31_Y0", "mm");
+      TVector3 C = blocks[i]->GetTVector3("X0_Y31", "mm");
+      TVector3 D = blocks[i]->GetTVector3("X31_Y31", "mm");
+      int     nbr_det = blocks[i]->GetInt("NUMBER_DSSSD");
+      double inter = blocks[i]->GetDouble("DISTANCE_INTER_DSSSD","mm");
+      double distance_cal = blocks[i]->GetDouble("DISTANCE_TRACKER_CALORIMETER","mm");
+      double thickness_cal = blocks[i]->GetDouble("THICKNESS_CALORIMETER","mm");
+      int    npixels_cal = blocks[i]->GetInt("NPIXELS_CALORIMETER");
+      int    tracker = blocks[i]->GetInt("TRACKER");
+      int    calorimeter = blocks[i]->GetInt("CALORIMETER");
+      int    vis= blocks[i]->GetInt("VIS");
+      AddComptonTelescope(A,B,C,D,size,nbr_strip);
+    }
+
+    else {
+      cout << "ERROR: check your input file formatting " << endl;
+      exit(1);
+    }
+  }
+
+  InitializeStandardParameter();
+  ReadAnalysisConfig();
+
+/*  // DSSSD blocks
   vector<NPL::InputBlock*> blocksDSSSD = parser.GetAllBlocksWithToken("DSSSD");
   if(NPOptionManager::getInstance()->GetVerboseLevel())
     cout << "//// " << blocksDSSSD.size() << " DSSSD detectors found " << endl; 
@@ -725,36 +783,9 @@ void TComptonTelescopePhysics::ReadConfiguration(NPL::InputParser parser){
     double distance_cal = blocksCompton[i]->GetDouble("DISTANCE_TRACKER_CALORIMETER","mm");
     int vis= blocksCompton[i]->GetInt("VIS");
   }
+*/
 
-  InitializeStandardParameter();
-  ReadAnalysisConfig();
 }
-/*  vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("ComptonTelescope");
-  if(NPOptionManager::getInstance()->GetVerboseLevel())
-    cout << "//// " << blocks.size() << " detectors found " << endl; 
-
-  vector<string> token = {"R","THETA","PHI","BETA","SIZE_DSSSD","NUMBER_DSSSD","DISTANCE_INTER_DSSSD","THICKNESS_DSSSD","NUMBER_STRIPS","DISTANCE_TRACKER_CALORIMETER","THICKNESS_CALORIMETER","TRACKER","CALORIMETER","VIS"};
-
-  for(unsigned int i = 0 ; i < blocks.size() ; i++){
-    if(blocks[i]->HasTokenList(token)){
-      double R = blocks[i]->GetDouble("R","mm");
-      double Theta = blocks[i]->GetDouble("THETA","deg");
-      double Phi = blocks[i]->GetDouble("PHI","deg");
-      vector<double> beta = blocks[i]->GetVectorDouble("BETA","deg"); 
-      double     size = blocks[i]->GetDouble("SIZE_DSSSD","mm");
-      int     nbr_det = blocks[i]->GetInt("NUMBER_DSSSD");
-      double inter = blocks[i]->GetDouble("DISTANCE_INTER_DSSSD","mm");
-      double thickness = blocks[i]->GetDouble("THICKNESS_DSSSD","mm");
-      int    nbr_strip = blocks[i]->GetInt("NUMBER_STRIPS");
-      double distance_cal = blocks[i]->GetDouble("DISTANCE_TRACKER_CALORIMETER","mm");
-      double thickness_cal = blocks[i]->GetDouble("THICKNESS_CALORIMETER","mm");
-      int    npixels_cal = blocks[i]->GetInt("NPIXELS_CALORIMETER");
-      int    tracker = blocks[i]->GetInt("TRACKER");
-      int    calorimeter = blocks[i]->GetInt("CALORIMETER");
-      int    vis= blocks[i]->GetInt("VIS");
-      AddComptonTelescope(R);
-    }
-*/
 
 ///////////////////////////////////////////////////////////////////////////
 void TComptonTelescopePhysics::AddParameterToCalibrationManager()
@@ -774,8 +805,10 @@ void TComptonTelescopePhysics::AddParameterToCalibrationManager()
       Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+1)+"_CHANNEL"+ NPL::itoa(j)+"_E",  "COMPTONTELESCOPE_D"+ NPL::itoa(i+1)+"_CHANNEL"+ NPL::itoa(j)+"_E");
       Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+3)+"_CHANNEL"+ NPL::itoa(j)+"_PED",  "COMPTONTELESCOPE_D"+ NPL::itoa(i+3)+"_CHANNEL"+ NPL::itoa(j)+"_PED");
       Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+4)+"_CHANNEL"+ NPL::itoa(j)+"_PED",  "COMPTONTELESCOPE_D"+ NPL::itoa(i+4)+"_CHANNEL"+ NPL::itoa(j)+"_PED");
+      Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+4)+"_CHANNEL"+ NPL::itoa(j)+"_COEFFALIGN",  "COMPTONTELESCOPE_D"+ NPL::itoa(i+4)+"_CHANNEL"+ NPL::itoa(j)+"_COEFFALIGN");
     }
     Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+1)+"_Q_E", "COMPTONTELESCOPE_D"+ NPL::itoa(i+1)+"_Q_E");
+    Cal->AddParameter("COMPTONTELESCOPE", "D"+ NPL::itoa(i+4)+"_E_CALO", "COMPTONTELESCOPE_D"+ NPL::itoa(i+4)+"_E_CALO");
   }
 
   return;  
@@ -802,15 +835,16 @@ void TComptonTelescopePhysics::InitializeRootInputPhysics()
   inputChain->SetBranchStatus("DetectorNumber",    true);
   inputChain->SetBranchStatus("Strip_Front",       true);
   inputChain->SetBranchStatus("Strip_Back",        true);
-  inputChain->SetBranchStatus("Strip_E",           true);
+  //inputChain->SetBranchStatus("Strip_E",           true);
   inputChain->SetBranchStatus("Strip_T",           true);
   inputChain->SetBranchStatus("Front_Energy",      true);
   inputChain->SetBranchStatus("Back_Energy",      true);
   inputChain->SetBranchStatus("Half_Energy",      true);
   inputChain->SetBranchStatus("Front_Time",      true);
   inputChain->SetBranchStatus("Back_Time",       true);
-  inputChain->SetBranchStatus("Same_FBTime",     true);
+  //inputChain->SetBranchStatus("Same_FBTime",     true);
   inputChain->SetBranchStatus("Calor_E",        true);
+  inputChain->SetBranchStatus("Calor_E_calib",  true);
   inputChain->SetBranchStatus("Calor_T",        true);
   inputChain->SetBranchStatus("CalorPosX",      true);
   inputChain->SetBranchStatus("CalorPosY",      true);
@@ -828,7 +862,8 @@ void TComptonTelescopePhysics::InitializeRootOutput()
 
 /////   Specific to ComptonTelescopeArray   ////
 
-void TComptonTelescopePhysics::AddDetectorDSSSD(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip)
+//void TComptonTelescopePhysics::AddDetectorDSSSD(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip)
+void TComptonTelescopePhysics::AddComptonTelescope(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip)
 {
   m_NumberOfDetectors++;
 
@@ -1029,7 +1064,17 @@ namespace ComptonTelescope_LOCAL
     return CalibrationManager::getInstance()->ApplyCalibration("COMPTONTELESCOPE/D" + NPL::itoa(m_EventData->GetCTCalorimeterEDetectorNbr(i)) + "_CHANNEL" + NPL::itoa(m_EventData->GetCTCalorimeterEChannelNbr(i)) + "_PED", m_EventData->GetCTCalorimeterEEnergy(i));
   }
 
-  Double_t fCalorimeter_Q(const TComptonTelescopeData* m_EventData, const int i) // Charge-ADC calibration
+  Double_t fCalorimeter_coeffAlign(const TComptonTelescopeData* m_EventData, const int i) // coeff to correct gain dispersion between pixels ("calibration de Jean")
+  {
+    return CalibrationManager::getInstance()->ApplyCalibration("COMPTONTELESCOPE/D" + NPL::itoa(m_EventData->GetCTCalorimeterEDetectorNbr(i)) + "_CHANNEL" + NPL::itoa(m_EventData->GetCTCalorimeterEChannelNbr(i)) + "_COEFFALIGN", m_EventData->GetCTCalorimeterEEnergy(i));
+  }
+
+  Double_t fCalorimeter_calibE(double sumADC, int detectorNumber) // ADC - Energy calibration
+  {
+    return CalibrationManager::getInstance()->ApplyCalibration("COMPTONTELESCOPE/D" + NPL::itoa(detectorNumber) + "_E_CALO", sumADC);
+  }
+
+ Double_t fCalorimeter_Q(const TComptonTelescopeData* m_EventData, const int i) // Charge-ADC calibration
   {
     return CalibrationManager::getInstance()->ApplyCalibration("COMPTONTELESCOPE/D" + NPL::itoa(m_EventData->GetCTCalorimeterEDetectorNbr(i)) + "_CHANNEL" + NPL::itoa(m_EventData->GetCTCalorimeterEChannelNbr(i)) + "_E", m_EventData->GetCTCalorimeterEEnergy(i));
   }
diff --git a/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.h b/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.h
index 5a48e1ea9ae741975190fb6aa4b54b11d10820db..8bb8fab15ae67b5eb9ad370ecc901a5078feca2b 100644
--- a/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.h
+++ b/NPLib/Detectors/ComptonTelescope/TComptonTelescopePhysics.h
@@ -57,6 +57,7 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
       //   DSSD
       int EventMultiplicity;
       vector<int> EventType;
+      //vector<int> TowerNumber;
       vector<int> DetectorNumber;
       vector<int>    Strip_Front;
       vector<int>    Strip_Back;
@@ -64,19 +65,21 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
       vector<double> Strip_T;
       vector<double> Front_Energy;
       vector<double> Back_Energy;
+      //vector<double> Half_Energy;
       vector<double> Front_Time;
       vector<double> Back_Time;
+      //vector<bool> Same_FBTime; 
       // Calorimeter
       vector<double> Calor_E;
       vector<double> Calor_T;
       vector<int>    CalorPosX;
       vector<int>    CalorPosY;
       multimap<int, vector<int>> CalorData;
+      vector<double> Calor_E_calib;
       // Both
       vector<int> deltaT;
       long int resetCount;
    
-
  
    public:  // inherited from VDetector
       // Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
@@ -141,7 +144,8 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
       void ReadAnalysisConfig();
          
       // Add a Detector
-      void AddDetectorDSSSD(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip);
+//      void AddDetectorDSSSD(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip);
+      void AddComptonTelescope(TVector3 C_X0_Y0, TVector3 C_X31_Y0, TVector3 C_X0_Y31, TVector3 C_X31_Y31, double size_dsssd, int nb_strip);
       void AddComptonTelescope(double Z);
       
       // Give and external TComptonTelescopeData object to TComptonTelescopePhysics
@@ -170,6 +174,8 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
       double GetHalfEnergy(const int i) {return Half_Energy[i];};
       double GetFrontTime(const int i) {return Front_Time[i];};
       double GetBackTime(const int i) {return Back_Time[i];};
+
+      double GetCalorEnergy(const int i) {return Calor_E_calib[i];};
       
       TVector3 GetPositionOfInteractionDSSSD(const int i) const;   
       TVector3 GetDetectorNormal(const int i) const;
@@ -227,7 +233,7 @@ class TComptonTelescopePhysics : public TObject, public NPL::VDetector
      ClassDef(TComptonTelescopePhysics,1)  // ComptonTelescopePhysics structure
 
 
-    public: // Add data for DSSSD analysis
+    public: // Add data for analysis
       // counters
       Int_t m_nCounterEvt; //!
       Int_t m_nCounterHit; //!
@@ -256,6 +262,8 @@ namespace ComptonTelescope_LOCAL
    double fCalorimeter_E(double charge, int detectorNumber);
    double fCalorimeter_Q(const TComptonTelescopeData* Data, const int i);
    double fCalorimeter_ped(const TComptonTelescopeData* Data, const int i);
+   double fCalorimeter_coeffAlign(const TComptonTelescopeData* Data, const int i);
+   double fCalorimeter_calibE(double sumADC, int detectorNumber);
 }
 
 
diff --git a/NPLib/Detectors/ComptonTelescope/TComptonTelescopeSpectra.cxx b/NPLib/Detectors/ComptonTelescope/TComptonTelescopeSpectra.cxx
index a44464a372bed11788247d377a5c20d26c0c66cd..852dd320680a718f76b3a3e41365799c0eb48e6e 100644
--- a/NPLib/Detectors/ComptonTelescope/TComptonTelescopeSpectra.cxx
+++ b/NPLib/Detectors/ComptonTelescope/TComptonTelescopeSpectra.cxx
@@ -97,14 +97,14 @@ void TComptonTelescopeSpectra::InitRawSpectra()
     // DSSSD
     for (unsigned int j = 0; j < fNumberOfDetectors; j++) {
 
-     // FRONT_E_RAW
+/*     // FRONT_E_RAW
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_E_RAW";
       AddHisto2D(name, name, fNumberOfStripsFront, 0, fNumberOfStripsFront, 512, 0, 1024, "COMPTONTELESCOPE/RAW/ENERGY");
 
       // BACK_E_RAW
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_E_RAW";
       AddHisto2D(name, name, fNumberOfStripsBack, 0, fNumberOfStripsBack, 512, 0, 1024, "COMPTONTELESCOPE/RAW/ENERGY");
-
+*/
       // E Front and Back vs Strip
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_BACK_E_RAW";
       AddHisto2D(name, name, ntot, 0, ntot, 512, 0, 1024, "COMPTONTELESCOPE/RAW/ENERGY");
@@ -162,38 +162,38 @@ void TComptonTelescopeSpectra::InitPreTreatedSpectra()
     // DSSSD
     for (unsigned int j = 0; j < fNumberOfDetectors; j++) {
 
-      // FRONT_E_CAL
+/*      // FRONT_E_CAL
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_E_CAL";
-      AddHisto2D(name, name, fNumberOfStripsFront, 0, fNumberOfStripsFront, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/ENERGY");
+      AddHisto2D(name, name, fNumberOfStripsFront, 0, fNumberOfStripsFront, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/ENERGY");
 
       // BACK_E_CAL
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_E_CAL";
-      AddHisto2D(name, name, fNumberOfStripsBack, 0, fNumberOfStripsBack, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/ENERGY");
-
+      AddHisto2D(name, name, fNumberOfStripsBack, 0, fNumberOfStripsBack, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/ENERGY");
+*/
       // E Front and Back vs Strip
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_BACK_E_CAL";
-      AddHisto2D(name, name, ntot, 0, ntot, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/ENERGY");
+      AddHisto2D(name, name, ntot, 0, ntot, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/ENERGY");
  
       // Front-Back Energy Correlation
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FB_COR_CAL";
-      AddHisto2D(name, name, 1400,0,1.4, 1400,0,1.4, "COMPTONTELESCOPE/CAL/ENERGYCOR");
+      AddHisto2D(name, name, 1400,0,1400, 1400,0,1400, "COMPTONTELESCOPE/CAL/ENERGYCOR");
    
       // Front E spectrum
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONTECAL_SPECTRUM";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/ENERGYSPEC");
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/ENERGYSPEC");
 
       // Back E spectrum
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACKECAL_SPECTRUM";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/ENERGYSPEC");
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/ENERGYSPEC");
 
       // FRONT_T_CAL
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_T_CAL";
       AddHisto1D(name, name, 5000, 0, 5e9, "COMPTONTELESCOPE/CAL/TIME");
 
-      // BACK_T_CAL
+/*      // BACK_T_CAL
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_T_CAL";
       AddHisto1D(name, name, 5000, 0, 5e9, "COMPTONTELESCOPE/CAL/TIME");
-
+*/
       // FRONT_CAL_MULT
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_CAL_MULT";
       AddHisto1D(name, name, fNumberOfStripsFront+1, 0, fNumberOfStripsFront+1, "COMPTONTELESCOPE/CAL/MULT");
@@ -202,7 +202,7 @@ void TComptonTelescopeSpectra::InitPreTreatedSpectra()
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_CAL_MULT";
       AddHisto1D(name, name, fNumberOfStripsBack+1, 0, fNumberOfStripsBack+1, "COMPTONTELESCOPE/CAL/MULT");
 
-      // Event type 1 multiplicity
+/*      // Event type 1 multiplicity
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_EVENTTYPE1_CAL_MULT";
       AddHisto1D(name, name, fNumberOfStripsBack+1, 0, fNumberOfStripsBack+1, "COMPTONTELESCOPE/CAL/EVENTTYPEMULT");
 
@@ -214,24 +214,24 @@ void TComptonTelescopeSpectra::InitPreTreatedSpectra()
       // Front
       // side by side strips
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_E_CLOSE_STRIP";
-      AddHisto2D(name, name, 1400, 0, 1.4, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");
+      AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");
       // + energy sum = E Back
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_E_INTERSTRIP";
-      AddHisto2D(name, name, 1400, 0, 1.4, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");
+      AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");
       // Back
       // side by side strips
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_E_CLOSE_STRIP";
-      AddHisto2D(name, name, 1400, 0, 1.4, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");
+      AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");
       // + energy sum = E Front
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_E_INTERSTRIP";
-      AddHisto2D(name, name, 1400, 0, 1.4, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");
+      AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");
       // FB correlation for interstrip
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FB_COR_INTERSTRIP";
-      AddHisto2D(name, name, 1400, 0, 1.4, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");      
+      AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");      
       // Half E spectrum for interstrip
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_HALFE_INTERSTRIP";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/CAL/INTERSTRIP");
-
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/CAL/INTERSTRIP");
+*/
       // Time multiplicity
       // Front
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_T_FRONT_CAL_MULT";
@@ -253,11 +253,12 @@ void TComptonTelescopeSpectra::InitPhysicsSpectra()
   int ntot = (fNumberOfStripsFront+fNumberOfStripsBack);
 
   // counters
-  name = "CT_DSSSD_COUNTERS_EVTS";
+/*  name = "CT_DSSSD_COUNTERS_EVTS";
   AddHisto1D(name, name, fNumberOfCounters, 0, fNumberOfCounters, "COMPTONTELESCOPE/PHY/COUNTER");
 
   name = "CT_DSSSD_COUNTERS_HITS";
   AddHisto1D(name, name, fNumberOfCounters, 0, fNumberOfCounters, "COMPTONTELESCOPE/PHY/COUNTER");
+*/
 
   // loop on number of telescopes
   for (unsigned int i = 0 ; i < fNumberOfTelescope ; i++) {
@@ -268,23 +269,23 @@ void TComptonTelescopeSpectra::InitPhysicsSpectra()
 
       // E Front + Back vs Strip
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_BACK_E_PHY";
-      AddHisto2D(name, name, ntot, 0, ntot, 1400, 0, 1.4, "COMPTONTELESCOPE/PHY/ENERGY");
+      AddHisto2D(name, name, ntot, 0, ntot, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/ENERGY");
 
       // front back Energy Correlation
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FB_COR_PHY";
-      AddHisto2D(name, name, 1400,0,1.4, 1400,0,1.4, "COMPTONTELESCOPE/PHY/ENERGYCOR");
+      AddHisto2D(name, name, 1400,0,1400, 1400,0,1400, "COMPTONTELESCOPE/PHY/ENERGYCOR");
  
       // Front E spectrum
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONTE_SPECTRUM";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
 
       // Back E spectrum
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACKE_SPECTRUM";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
 
       // Half E spectrum
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_HALFE_SPECTRUM";
-      AddHisto1D(name, name, 1400, 0, 1.4, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
+      AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/ENERGYSPEC");
 
       // Multiplicity
       int MultMax = fNumberOfStripsFront*fNumberOfStripsBack;
@@ -295,10 +296,10 @@ void TComptonTelescopeSpectra::InitPhysicsSpectra()
       // Front
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_FRONT_T_PHY";
       AddHisto1D(name, name, 5000, -2000, 5e9, "COMPTONTELESCOPE/PHY/TIME");
-      // Back
+/*      // Back
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_BACK_T_PHY";
       AddHisto1D(name, name, 5000, -2000, 5e9, "COMPTONTELESCOPE/PHY/TIME");
-
+*/
       // Hit pattern
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_HIT_PHY";
       int ntotF = fNumberOfStripsFront * fNumberOfDetectors;
@@ -307,28 +308,32 @@ void TComptonTelescopeSpectra::InitPhysicsSpectra()
  
       // X-Y Impact Matrix
       name = "CT"+NPL::itoa(i+1)+"_DSSSD"+NPL::itoa(j+1)+"_IMPACT_MATRIX";
-      AddHisto2D(name, name, 80, -40, 40, 80, -40, 40, "COMPTONTELESCOPE/PHY/IMPACTMATRIX");
+      AddHisto2D(name, name, 40, -40, 40, 40, -40, 40, "COMPTONTELESCOPE/PHY/IMPACTMATRIX");
 
     }
 
     // X-Y Energy Correlation
-    name = "CT"+NPL::itoa(i+1)+"_XY_COR";
-    AddHisto2D(name, name,500,0,50,500,0,50, "COMPTONTELESCOPE/PHY");
-
-    // Calorimeter energy spectrum
-    name = "CT"+NPL::itoa(i+1)+"_CALOR_SPECTRUM";
-    AddHisto1D(name, name, 1000, 1, 2000, "COMPTONTELESCOPE/PHY/CALOR");
+//    name = "CT"+NPL::itoa(i+1)+"_XY_COR";
+//    AddHisto2D(name, name,500,0,50,500,0,50, "COMPTONTELESCOPE/PHY");
 
     // Position on calorimeter
     name = "CT"+NPL::itoa(i+1)+"_CALOR_POS";
     AddHisto2D(name, name, 8, -24, 24, 8, -24, 24, "COMPTONTELESCOPE/PHY/CALOR_POS");
 
+    // Calorimeter energy spectrum
+    name = "CT"+NPL::itoa(i+1)+"_CALOR_SPECTRUM";
+    AddHisto1D(name, name, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/CALOR_SPECTRUM");
+
     // Sum spectrum
     name = "CT"+NPL::itoa(i+1)+"_SUM_SPECTRUM";
-    AddHisto1D(name, name, 1000, 1, 2000, "COMPTONTELESCOPE/PHY/CALOR");
+    AddHisto1D(name, name, 1000, 0, 2000, "COMPTONTELESCOPE/PHY/CALOR_SUM");
 
+    // Bidim sum
     name = "CT"+NPL::itoa(i+1)+"_SUM_BIDIM";
-    AddHisto2D(name, name, 1400, 0, 1.4, 1000, 0, 500000, "COMPTONTELESCOPE/PHY/SUM_BIDIM");
+    AddHisto2D(name, name, 1400, 0, 1400, 1000, 0, 500000, "COMPTONTELESCOPE/PHY/SUM_BIDIM");
+
+    name = "CT"+NPL::itoa(i+1)+"_SUM_BIDIM_CAL";
+    AddHisto2D(name, name, 1400, 0, 1400, 1400, 0, 1400, "COMPTONTELESCOPE/PHY/SUM_BIDIM");
 
     // DELTA T
     name = "CT"+NPL::itoa(i+1)+"_DELTA_T";
@@ -345,7 +350,7 @@ void TComptonTelescopeSpectra::FillRawSpectra(TComptonTelescopeData* RawData)
   string family;
 
   // FRONT_E 
-  for (unsigned int i = 0; i < RawData->GetCTTrackerFrontEMult(); i++) {    
+/*  for (unsigned int i = 0; i < RawData->GetCTTrackerFrontEMult(); i++) {    
     name = "CT"+NPL::itoa(RawData->GetCTTrackerFrontETowerNbr(i))+"_DSSSD"+NPL::itoa(RawData->GetCTTrackerFrontEDetectorNbr(i))+"_FRONT_E_RAW";
     family = "COMPTONTELESCOPE/RAW/ENERGY";
 //    if (RawData->GetCTTrackerFrontTTime(i) > 3e9) {
@@ -367,7 +372,7 @@ void TComptonTelescopeSpectra::FillRawSpectra(TComptonTelescopeData* RawData)
           RawData->GetCTTrackerBackEEnergy(i));
 //    }
   }
-
+*/
   // E Front Back vs Strip
   family = "COMPTONTELESCOPE/RAW/ENERGY";
   for (unsigned int i = 0; i < RawData->GetCTTrackerFrontEMult(); i++) {
@@ -495,7 +500,7 @@ void TComptonTelescopeSpectra::FillPreTreatedSpectra(TComptonTelescopeData* PreT
   string name;
   string family;
   
-  // FRONT_E
+/*  // FRONT_E
   for (unsigned int i = 0; i < PreTreatedData->GetCTTrackerFrontEMult(); i++) {
 //    if (PreTreatedData->GetCTTrackerFrontTTime(i) > 3e9) {
     name = "CT"+NPL::itoa(PreTreatedData->GetCTTrackerFrontETowerNbr(i))+"_DSSSD"+NPL::itoa(PreTreatedData->GetCTTrackerFrontEDetectorNbr(i))+"_FRONT_E_CAL";
@@ -516,7 +521,7 @@ void TComptonTelescopeSpectra::FillPreTreatedSpectra(TComptonTelescopeData* PreT
           PreTreatedData->GetCTTrackerBackEEnergy(i));
 //    }
   }
-
+*/
   // E Front Back vs Strip
   family = "COMPTONTELESCOPE/CAL/ENERGY";
   for (unsigned int i = 0; i < PreTreatedData->GetCTTrackerFrontEMult(); i++) {
@@ -564,13 +569,13 @@ void TComptonTelescopeSpectra::FillPreTreatedSpectra(TComptonTelescopeData* PreT
     family = "COMPTONTELESCOPE/CAL/TIME";
     FillSpectra(family,name, PreTreatedData->GetCTTrackerFrontTTime(i));
   }
-  // BACK_T
+/*  // BACK_T
   for (unsigned int i = 0; i < PreTreatedData->GetCTTrackerBackTMult(); i++) {
     name = "CT"+NPL::itoa(PreTreatedData->GetCTTrackerBackTTowerNbr(i))+"_DSSSD"+NPL::itoa(PreTreatedData->GetCTTrackerBackTDetectorNbr(i))+"_BACK_T_CAL";
     family = "COMPTONTELESCOPE/CAL/TIME";
     FillSpectra(family,name, PreTreatedData->GetCTTrackerBackTTime(i));
   }
-
+*/
   // FRONT MULT
   int myMULT[fNumberOfTelescope][fNumberOfDetectors];
   for( unsigned int i = 0; i < fNumberOfTelescope; i++) {
@@ -606,7 +611,7 @@ void TComptonTelescopeSpectra::FillPreTreatedSpectra(TComptonTelescopeData* PreT
     }
   }
 
-  // Event type
+/*  // Event type
   // type 1 (mult front = mult back)
   for(unsigned int i = 0; i < fNumberOfTelescope; i++) {
     for (unsigned int j = 0; j < fNumberOfDetectors; j++) {
@@ -706,7 +711,7 @@ void TComptonTelescopeSpectra::FillPreTreatedSpectra(TComptonTelescopeData* PreT
         FillSpectra(family,name, (PreTreatedData->GetCTTrackerFrontEEnergy(0)+PreTreatedData->GetCTTrackerBackEEnergy(0)+PreTreatedData->GetCTTrackerBackEEnergy(1))/2.);
     }
     }
-  }
+  }*/
 
 
   // Time Multiplicity 
@@ -754,7 +759,7 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
   //// DSSSD
 
   // counters
-  // for events
+/*  // for events
   name = "CT_DSSSD_COUNTERS_EVTS";
   family= "COMPTONTELESCOPE/PHY/COUNTER";
   for (unsigned int i = 0; i < fNumberOfCounters; i++) {
@@ -765,7 +770,7 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
   family= "COMPTONTELESCOPE/PHY/COUNTER";
   for (unsigned int i = 0; i < fNumberOfCounters; i++) {
     FillSpectra(family, name, i, Physics->m_CounterHit[i]);
-  }
+  }*/
 
   // Front + Back E per strip
   for (unsigned int i = 0; i < Physics->GetEventMultiplicity(); i++) {
@@ -827,13 +832,13 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
     family= "COMPTONTELESCOPE/PHY/TIME";
     FillSpectra(family,name,Physics->GetFrontTime(i));
   }
-  // Back
+/*  // Back
   for (unsigned int i = 0; i < Physics->GetEventMultiplicity(); i++) {
     name = "CT"+NPL::itoa(Physics->GetTowerNumber(i))+"_DSSSD"+NPL::itoa(Physics->GetDetectorNumber(i))+"_BACK_T_PHY";
     family= "COMPTONTELESCOPE/PHY/TIME";
     FillSpectra(family,name,Physics->GetBackTime(i));
   }
-
+*/
   // Hit pattern
   for (unsigned int i = 0; i < Physics->GetEventMultiplicity(); i++) {
     name = "CT"+NPL::itoa(Physics->GetTowerNumber(i))+"_DSSSD"+NPL::itoa(Physics->GetDetectorNumber(i))+"_HIT_PHY";
@@ -856,6 +861,7 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
   // Position on calorimeter
   for (unsigned int i = 0; i < fNumberOfTelescope; i++) {
     name = "CT"+NPL::itoa(i+1)+"_CALOR_POS";
+    family = "COMPTONTELESCOPE/PHY/CALOR_POS";
     if (Physics->CalorPosX.size() == Physics->CalorPosY.size()) {
       for (int j = 0; j < Physics->CalorPosX.size(); j++) {
         FillSpectra(family, name, Physics->CalorPosX[j], Physics->CalorPosY[j]);
@@ -866,30 +872,38 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
   }
 
   // Calorimeters spectra
-  double energy = 0;
+//  double energy = 0;
   for (unsigned int i = 0; i < fNumberOfTelescope; i++) {
     name = "CT"+NPL::itoa(i+1)+"_CALOR_SPECTRUM";
-    energy = 0;
-    for (unsigned int j = 0; j < Physics->Calor_E.size(); j++) {
-      energy += Physics->Calor_E[j];
+    family = "COMPTONTELESCOPE/PHY/CALOR_SPECTRUM";
+//    energy = 0;
+//    for (unsigned int j = 0; j < Physics->Calor_E.size(); j++) {
+    for (unsigned int j = 0; j < Physics->Calor_E_calib.size(); j++) {
+//      energy += Physics->Calor_E[j];
+      FillSpectra(family, name, Physics->GetCalorEnergy(j));
     }
-    FillSpectra(family, name, energy);
+//    FillSpectra(family, name, energy);
   }
 
-  // Sum spectrum
+/*  // Sum spectrum
+  double energy = 0;
   for (unsigned int i = 0; i < fNumberOfTelescope; i++) {
     name = "CT"+NPL::itoa(i+1)+"_SUM_SPECTRUM";
+    family = "COMPTONTELESCOPE/PHY/CALOR_SUM";
     energy = 0;
-    for (unsigned int j = 0; j < Physics->Strip_E.size();j++) {
-      energy += Physics->Strip_E[j];
+//    for (unsigned int j = 0; j < Physics->Strip_E.size();j++) {
+    for (unsigned int j = 0; j < Physics->GetEventMultiplicity();j++) {
+//      energy += Physics->Strip_E[j];
+      energy = Physics->GetHalfEnergy(j);
     }
-    for (unsigned int j = 0; j < Physics->Calor_E.size(); j++) {
-      energy += Physics->Calor_E[j];
+//    for (unsigned int j = 0; j < Physics->Calor_E.size(); j++) {
+    for (unsigned int j = 0; j < Physics->Calor_E_calib.size(); j++) {
+      energy += Physics->GetCalorEnergy(j);
     }
     FillSpectra(family, name, energy);
   }
-
-  // SUM BIDIM
+*/
+  // SUM BIDIM not calibrated
   for (unsigned int i = 0 ; i < Physics->GetEventMultiplicity(); i++) {
     for (unsigned int j = 0; j < Physics->Calor_E.size(); j++) {
       name = "CT"+NPL::itoa(Physics->GetTowerNumber(i))+"_SUM_BIDIM";
@@ -903,6 +917,21 @@ void TComptonTelescopeSpectra::FillPhysicsSpectra(TComptonTelescopePhysics* Phys
     }
   }
 
+  // SUM BIDIM calibrated
+  for (unsigned int i = 0 ; i < Physics->GetEventMultiplicity(); i++) {
+    for (unsigned int j = 0; j < Physics->Calor_E_calib.size(); j++) {
+      name = "CT"+NPL::itoa(Physics->GetTowerNumber(i))+"_SUM_BIDIM_CAL";
+      family = "COMPTONTELESCOPE/PHY/SUM_BIDIM";
+//      int sumE = 0;
+//      for (int j = 0; j<64; j++) {
+//        sumE += RawData->GetCTCalorimeterEEnergy(j);
+//      }
+      FillSpectra(family, name,
+          Physics->GetFrontEnergy(i), Physics->GetCalorEnergy(j));
+    }
+  }
+
+
   // DELTA T
   for (unsigned int i = 0; i < fNumberOfTelescope; i++) {
     name = "CT"+NPL::itoa(i+1)+"_DELTA_T";
diff --git a/Projects/ComptonTelescope/online/ComptonCAM.detector b/Projects/ComptonTelescope/online/ComptonCAM.detector
index 1d61c2e51d864058f46e9c2f637165bf100cb060..ca1d95f1cb358cc09a148ace4b51618d34d0dcc7 100644
--- a/Projects/ComptonTelescope/online/ComptonCAM.detector
+++ b/Projects/ComptonTelescope/online/ComptonCAM.detector
@@ -1,23 +1,17 @@
-%%%%%% DSSSD 1 %%%%%%
-DSSSD
-  NUMBER_DSSSD= 1
-  X0_Y0=   32.0   32.0   0.0
-  X31_Y0=  -32.0  32.0   0.0
-  X0_Y31=  32.0   -32.0  0.0
-  X31_Y31= -32.0  -32.0  0.0
-  SIZE_DSSSD= 64 mm
-  THICKNESS_DSSSD= 1.5 mm
-  NUMBER_STRIPS= 32
-
-%%%%%% CALORIMETER 1 %%%%%%
-CALORIMETER
-  NUMBER_CALORIMETER= 4
-  THICKNESS_CALORIMETER= 10 mm
-  NPIXELS_CALORIMETER= 64
-
-%%%%%% ComptonTelescope %%%%%%
-ComptonTelescope
-   TRACKER= 1
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ComptonTelescope   
+   SIZE_DSSSD= 64 mm
+   THICKNESS_DSSSD= 1.5 mm
+   NUMBER_STRIPS= 32
+   X0_Y0=   -32.0   32.0   0.0
+   X31_Y0=  32.0  32.0   0.0
+   X0_Y31=  -32.0   -32.0  0.0
+   X31_Y31= 32.0  -32.0  0.0
+   NUMBER_DSSSD= 1 
    DISTANCE_INTER_DSSSD= 10 mm
    DISTANCE_TRACKER_CALORIMETER= 20 mm
+   THICKNESS_CALORIMETER= 10 mm
+   NPIXELS_CALORIMETER= 64
+   TRACKER= 1
+   CALORIMETER= 4
    VIS= 1
diff --git a/Projects/ComptonTelescope/online/ComptonCAM_ini.detector b/Projects/ComptonTelescope/online/ComptonCAM_ini.detector
deleted file mode 100644
index cdfcea2603223fc78f460916ee79c66b98990f66..0000000000000000000000000000000000000000
--- a/Projects/ComptonTelescope/online/ComptonCAM_ini.detector
+++ /dev/null
@@ -1,17 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-ComptonTelescope
-   R= 150 mm
-   THETA= 0 deg
-   PHI= 0 deg 
-   BETA= 0 0 0 deg
-   SIZE_DSSSD= 64 mm
-   NUMBER_DSSSD= 1 
-   DISTANCE_INTER_DSSSD= 10 mm
-   THICKNESS_DSSSD= 1.5 mm
-   NUMBER_STRIPS= 32
-   DISTANCE_TRACKER_CALORIMETER= 20 mm
-   THICKNESS_CALORIMETER= 10 mm
-   NPIXELS_CALORIMETER= 64
-   TRACKER= 1
-   CALORIMETER= 4
-   VIS= 1
diff --git a/Projects/ComptonTelescope/online/calibrations.txt b/Projects/ComptonTelescope/online/calibrations.txt
index 71fec4f007c5fd8a5884236e9e18638b0c027143..aeec75b7d0cbb27bf78009ef2ccaeef21432c84d 100644
--- a/Projects/ComptonTelescope/online/calibrations.txt
+++ b/Projects/ComptonTelescope/online/calibrations.txt
@@ -1,6 +1,9 @@
 CalibrationFilePath
+%  ./calibrations/DSSSD_calibration_withPed_pol3_ok.txt
   ./calibrations/DSSSD_D1_Calibration_run10_newCal.txt
   ./calibrations/CeBr3_PED.txt
   ./calibrations/CeBr3_PED3.txt
   ./calibrations/CeBr3_PED4.txt
+  ./calibrations/CeBr3_mod4_CoeffAlign.txt
+  ./calibrations/CeBr3_mod4_calibE.txt
   ./calibrations/CeBr3_E.txt
diff --git a/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_CoeffAlign.txt b/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_CoeffAlign.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5cf5bb51a339d3da0dff5d56076cf39510718dd8
--- /dev/null
+++ b/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_CoeffAlign.txt
@@ -0,0 +1,64 @@
+COMPTONTELESCOPE_D4_CHANNEL0_COEFFALIGN     0    1.071355  
+COMPTONTELESCOPE_D4_CHANNEL1_COEFFALIGN	    0    1.053576  
+COMPTONTELESCOPE_D4_CHANNEL2_COEFFALIGN	    0    1.039590  
+COMPTONTELESCOPE_D4_CHANNEL3_COEFFALIGN	    0    1.031160  
+COMPTONTELESCOPE_D4_CHANNEL4_COEFFALIGN	    0    1.041445  
+COMPTONTELESCOPE_D4_CHANNEL5_COEFFALIGN	    0    1.048102  
+COMPTONTELESCOPE_D4_CHANNEL6_COEFFALIGN	    0    1.057513  
+COMPTONTELESCOPE_D4_CHANNEL7_COEFFALIGN	    0    1.069637  
+COMPTONTELESCOPE_D4_CHANNEL8_COEFFALIGN	    0    1.053397  
+COMPTONTELESCOPE_D4_CHANNEL9_COEFFALIGN	    0    1.035636  
+COMPTONTELESCOPE_D4_CHANNEL10_COEFFALIGN	  0    1.020023  
+COMPTONTELESCOPE_D4_CHANNEL11_COEFFALIGN	  0    1.016343  
+COMPTONTELESCOPE_D4_CHANNEL12_COEFFALIGN	  0    1.025909  
+COMPTONTELESCOPE_D4_CHANNEL13_COEFFALIGN	  0    1.042392  
+COMPTONTELESCOPE_D4_CHANNEL14_COEFFALIGN	  0    1.040673  
+COMPTONTELESCOPE_D4_CHANNEL15_COEFFALIGN	  0    1.053967  
+COMPTONTELESCOPE_D4_CHANNEL16_COEFFALIGN	  0    1.047104  
+COMPTONTELESCOPE_D4_CHANNEL17_COEFFALIGN	  0    1.027073  
+COMPTONTELESCOPE_D4_CHANNEL18_COEFFALIGN	  0    1.012284  
+COMPTONTELESCOPE_D4_CHANNEL19_COEFFALIGN	  0    1.006601  
+COMPTONTELESCOPE_D4_CHANNEL20_COEFFALIGN	  0    1.019735  
+COMPTONTELESCOPE_D4_CHANNEL21_COEFFALIGN	  0    1.025754  
+COMPTONTELESCOPE_D4_CHANNEL22_COEFFALIGN	  0    1.015511  
+COMPTONTELESCOPE_D4_CHANNEL23_COEFFALIGN	  0    1.048024  
+COMPTONTELESCOPE_D4_CHANNEL24_COEFFALIGN	  0    1.049874  
+COMPTONTELESCOPE_D4_CHANNEL25_COEFFALIGN	  0    1.028576  
+COMPTONTELESCOPE_D4_CHANNEL26_COEFFALIGN	  0    1.013186  
+COMPTONTELESCOPE_D4_CHANNEL27_COEFFALIGN	  0    1.000000  
+COMPTONTELESCOPE_D4_CHANNEL28_COEFFALIGN	  0    1.006663  
+COMPTONTELESCOPE_D4_CHANNEL29_COEFFALIGN	  0    1.016947  
+COMPTONTELESCOPE_D4_CHANNEL30_COEFFALIGN	  0    1.029416  
+COMPTONTELESCOPE_D4_CHANNEL31_COEFFALIGN	  0    1.049713  
+COMPTONTELESCOPE_D4_CHANNEL32_COEFFALIGN	  0    1.059806  
+COMPTONTELESCOPE_D4_CHANNEL33_COEFFALIGN	  0    1.036524  
+COMPTONTELESCOPE_D4_CHANNEL34_COEFFALIGN	  0    1.018387  
+COMPTONTELESCOPE_D4_CHANNEL35_COEFFALIGN	  0    1.007346  
+COMPTONTELESCOPE_D4_CHANNEL36_COEFFALIGN	  0    1.006239  
+COMPTONTELESCOPE_D4_CHANNEL37_COEFFALIGN	  0    1.014444  
+COMPTONTELESCOPE_D4_CHANNEL38_COEFFALIGN	  0    1.028157  
+COMPTONTELESCOPE_D4_CHANNEL39_COEFFALIGN	  0    1.051142  
+COMPTONTELESCOPE_D4_CHANNEL40_COEFFALIGN	  0    1.066858  
+COMPTONTELESCOPE_D4_CHANNEL41_COEFFALIGN	  0    1.047149  
+COMPTONTELESCOPE_D4_CHANNEL42_COEFFALIGN	  0    1.028777  
+COMPTONTELESCOPE_D4_CHANNEL43_COEFFALIGN	  0    1.019922  
+COMPTONTELESCOPE_D4_CHANNEL44_COEFFALIGN	  0    1.017889  
+COMPTONTELESCOPE_D4_CHANNEL45_COEFFALIGN	  0    1.023787  
+COMPTONTELESCOPE_D4_CHANNEL46_COEFFALIGN	  0    1.038220  
+COMPTONTELESCOPE_D4_CHANNEL47_COEFFALIGN	  0    1.061258  
+COMPTONTELESCOPE_D4_CHANNEL48_COEFFALIGN	  0    1.083887  
+COMPTONTELESCOPE_D4_CHANNEL49_COEFFALIGN	  0    1.064693  
+COMPTONTELESCOPE_D4_CHANNEL50_COEFFALIGN	  0    1.048082  
+COMPTONTELESCOPE_D4_CHANNEL51_COEFFALIGN	  0    1.038399  
+COMPTONTELESCOPE_D4_CHANNEL52_COEFFALIGN	  0    1.036104  
+COMPTONTELESCOPE_D4_CHANNEL53_COEFFALIGN	  0    1.040000  
+COMPTONTELESCOPE_D4_CHANNEL54_COEFFALIGN	  0    1.057012  
+COMPTONTELESCOPE_D4_CHANNEL55_COEFFALIGN	  0    1.079617  
+COMPTONTELESCOPE_D4_CHANNEL56_COEFFALIGN	  0    1.100700  
+COMPTONTELESCOPE_D4_CHANNEL57_COEFFALIGN	  0    1.085763  
+COMPTONTELESCOPE_D4_CHANNEL58_COEFFALIGN	  0    1.071452  
+COMPTONTELESCOPE_D4_CHANNEL59_COEFFALIGN	  0    1.061425  
+COMPTONTELESCOPE_D4_CHANNEL60_COEFFALIGN	  0    1.059046  
+COMPTONTELESCOPE_D4_CHANNEL61_COEFFALIGN	  0    1.065397  
+COMPTONTELESCOPE_D4_CHANNEL62_COEFFALIGN	  0    1.079880  
+COMPTONTELESCOPE_D4_CHANNEL63_COEFFALIGN	  0    1.100298  
diff --git a/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_calibE.txt b/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_calibE.txt
new file mode 100644
index 0000000000000000000000000000000000000000..99c253ac9bb023fe8830a3af4f1b333dc73f3c1c
--- /dev/null
+++ b/Projects/ComptonTelescope/online/calibrations/CeBr3_mod4_calibE.txt
@@ -0,0 +1 @@
+COMPTONTELESCOPE_D4_E_CALO   1.0874e+01   3.9321e-03   4.0809e-09
diff --git a/Projects/ComptonTelescope/online/calibrations/DSSSD_D1_Calibration_run5.txt b/Projects/ComptonTelescope/online/calibrations/DSSSD_D1_Calibration_run5.txt
new file mode 100644
index 0000000000000000000000000000000000000000..feb2ff3ce4d9150f2988c9fb51f08c7c1c319b8f
--- /dev/null
+++ b/Projects/ComptonTelescope/online/calibrations/DSSSD_D1_Calibration_run5.txt
@@ -0,0 +1,64 @@
+COMPTONTELESCOPE_D1_STRIP_FRONT0_E	-0.122331	0.00196619	-1.18533e-06	4.90119e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT1_E	-0.127383	0.00197971	-1.22355e-06	5.27075e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT2_E	-0.129792	0.00200149	-1.2383e-06	5.13228e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT3_E	-0.132745	0.0020174	-1.261e-06	5.28125e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT4_E	-0.140946	0.0019832	-1.19557e-06	4.84516e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT5_E	-0.14763	0.00198989	-1.20832e-06	4.90817e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT6_E	-0.130626	0.00199244	-1.24892e-06	5.22536e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT7_E	-0.125118	0.00199209	-1.24272e-06	5.15464e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT8_E	-0.140944	0.00199458	-1.20239e-06	4.84414e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT9_E	-0.141862	0.00200111	-1.2125e-06	4.87513e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT10_E	-0.136693	0.00199002	-1.22987e-06	5.06433e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT11_E	-0.128208	0.001991	-1.2281e-06	5.04886e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT12_E	-0.133733	0.00200753	-1.26194e-06	5.25582e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT13_E	-0.147415	0.00201033	-1.25019e-06	5.16535e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT14_E	-0.136694	0.00202633	-1.29112e-06	5.38377e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT15_E	-0.138304	0.00201046	-1.25684e-06	5.19117e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT16_E	-0.135026	0.00200989	-1.26828e-06	5.30732e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT17_E	-0.131312	0.00202091	-1.28389e-06	5.37983e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT18_E	-0.150142	0.00203392	-1.29006e-06	5.35645e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT19_E	-0.146407	0.00203905	-1.29278e-06	5.35372e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT20_E	-0.134805	0.00201631	-1.26884e-06	5.25375e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT21_E	-14.7761	0.193737	0.000828877	-1.02213e-05
+COMPTONTELESCOPE_D1_STRIP_FRONT22_E	-0.134091	0.00202432	-1.28227e-06	5.30007e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT23_E	-0.133431	0.00201731	-1.27378e-06	5.26883e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT24_E	-0.12846	0.00201312	-1.27122e-06	5.26039e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT25_E	-0.135822	0.00202878	-1.28067e-06	5.27611e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT26_E	-0.124599	0.00204076	-1.31295e-06	5.50097e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT27_E	-0.118449	0.00201018	-1.27116e-06	5.29798e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT28_E	-0.129738	0.00204939	-1.31603e-06	5.46584e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT29_E	-0.12438	0.00202864	-1.30698e-06	5.48131e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT30_E	-0.122517	0.00198939	-1.21051e-06	4.92433e-10
+COMPTONTELESCOPE_D1_STRIP_FRONT31_E	-0.131915	0.00203082	-1.3146e-06	5.59213e-10
+COMPTONTELESCOPE_D1_STRIP_BACK0_E	-0.0424301	0.00119877	1.33846e-07	-2.34316e-10
+COMPTONTELESCOPE_D1_STRIP_BACK1_E	-0.081211	0.00144181	-4.84814e-07	2.01167e-10
+COMPTONTELESCOPE_D1_STRIP_BACK2_E	-0.0508381	0.00120969	1.03733e-07	-1.89451e-10
+COMPTONTELESCOPE_D1_STRIP_BACK3_E	-0.0605604	0.00124665	3.10533e-08	-1.5051e-10
+COMPTONTELESCOPE_D1_STRIP_BACK4_E	0.80082	-0.020885	6.37338e-05	-4.28565e-08
+COMPTONTELESCOPE_D1_STRIP_BACK5_E	0.80082	-0.0204461	6.23318e-05	-4.18889e-08
+COMPTONTELESCOPE_D1_STRIP_BACK6_E	0.80082	-0.0219271	6.70629e-05	-4.51541e-08
+COMPTONTELESCOPE_D1_STRIP_BACK7_E	-0.0723353	0.00134687	-4.52896e-08	-1.4229e-10
+COMPTONTELESCOPE_D1_STRIP_BACK8_E	-0.0303402	0.00168424	-8.77559e-07	3.01959e-10
+COMPTONTELESCOPE_D1_STRIP_BACK9_E	-0.0589314	0.00124818	2.28379e-08	-1.43175e-10
+COMPTONTELESCOPE_D1_STRIP_BACK10_E	-0.0409112	0.00124592	9.39846e-09	-1.3515e-10
+COMPTONTELESCOPE_D1_STRIP_BACK11_E	-0.0505916	0.00123388	5.78914e-08	-1.66542e-10
+COMPTONTELESCOPE_D1_STRIP_BACK12_E	-0.0550734	0.001116	3.84518e-07	-3.9828e-10
+COMPTONTELESCOPE_D1_STRIP_BACK13_E	-0.0583082	0.00123571	4.22799e-08	-1.52519e-10
+COMPTONTELESCOPE_D1_STRIP_BACK14_E	-0.0542201	0.00112746	3.66211e-07	-3.90339e-10
+COMPTONTELESCOPE_D1_STRIP_BACK15_E	-0.0578725	0.00123372	4.27101e-08	-1.52595e-10
+COMPTONTELESCOPE_D1_STRIP_BACK16_E	-0.0688206	0.00138	-3.62424e-07	1.3062e-10
+COMPTONTELESCOPE_D1_STRIP_BACK17_E	-0.0585802	0.00126622	-5.99937e-09	-1.3215e-10
+COMPTONTELESCOPE_D1_STRIP_BACK18_E	-0.048492	0.00122269	8.08802e-08	-1.83059e-10
+COMPTONTELESCOPE_D1_STRIP_BACK19_E	-0.0668649	0.0012489	3.38777e-08	-1.48626e-10
+COMPTONTELESCOPE_D1_STRIP_BACK20_E	-3.47996	1.72432	-0.114916	0.00196065
+COMPTONTELESCOPE_D1_STRIP_BACK21_E	-0.0688447	0.00124418	6.62098e-08	-1.82455e-10
+COMPTONTELESCOPE_D1_STRIP_BACK22_E	-0.0358515	0.000952042	7.33555e-07	-6.00657e-10
+COMPTONTELESCOPE_D1_STRIP_BACK23_E	-0.0732278	0.00141708	-4.37693e-07	1.67282e-10
+COMPTONTELESCOPE_D1_STRIP_BACK24_E	-0.0507889	0.00113775	3.13225e-07	-3.53394e-10
+COMPTONTELESCOPE_D1_STRIP_BACK25_E	-0.067179	0.00117007	2.71751e-07	-3.28545e-10
+COMPTONTELESCOPE_D1_STRIP_BACK26_E	-0.0663249	0.00124381	4.97362e-08	-1.66732e-10
+COMPTONTELESCOPE_D1_STRIP_BACK27_E	-0.0754274	0.0012026	1.92584e-07	-2.76707e-10
+COMPTONTELESCOPE_D1_STRIP_BACK28_E	-0.067838	0.00123731	9.55379e-08	-2.01108e-10
+COMPTONTELESCOPE_D1_STRIP_BACK29_E	-0.0635459	0.00125404	4.81128e-08	-1.76049e-10
+COMPTONTELESCOPE_D1_STRIP_BACK30_E	12.0005	-1.74316	0.0527337	-0.000431853
+COMPTONTELESCOPE_D1_STRIP_BACK31_E	-0.069083	0.00126844	2.14296e-08	-1.56843e-10
diff --git a/Projects/ComptonTelescope/online/configs/ConfigComptonTelescope.dat b/Projects/ComptonTelescope/online/configs/ConfigComptonTelescope.dat
index f70468ddd860ff7eb5060b7980b83ee7b787f0cd..270f3e1bc9853ad87690e63bb53ee3971aeb995a 100644
--- a/Projects/ComptonTelescope/online/configs/ConfigComptonTelescope.dat
+++ b/Projects/ComptonTelescope/online/configs/ConfigComptonTelescope.dat
@@ -1,12 +1,12 @@
 ConfigComptonTelescope
    MAX_STRIP_MULTIPLICITY                 32
    ONLY_GOOD_COUPLE_WITH_MULTIPLICITY_ONE ON
-   FRONT_BACK_ENERGY_MATCHING_SIGMA       0.006
+   FRONT_BACK_ENERGY_MATCHING_SIGMA       6
    FRONT_BACK_ENERGY_MATCHING_NUMBER_OF_SIGMA  2
    DISABLE_CHANNEL COMPTONTELESCOPE_D1_STRIP_FRONT21_E
    DISABLE_CHANNEL COMPTONTELESCOPE_D1_STRIP_BACK18_E
    DISABLE_CHANNEL COMPTONTELESCOPE_D1_STRIP_BACK22_E
    STRIP_FRONT_E_RAW_THRESHOLD            0
    STRIP_BACK_E_RAW_THRESHOLD             0
-   STRIP_FRONT_E_THRESHOLD                0.012
-   STRIP_BACK_E_THRESHOLD                 0.012
+   STRIP_FRONT_E_THRESHOLD                12
+   STRIP_BACK_E_THRESHOLD                 12
diff --git a/Projects/ComptonTelescope/online/src/online_coinc.cpp b/Projects/ComptonTelescope/online/src/online_coinc.cpp
index e4d5dfbff2d7de9f695159b46d06123d473ebdf0..70368bf56ccf33725348345525053f79ad08af57 100644
--- a/Projects/ComptonTelescope/online/src/online_coinc.cpp
+++ b/Projects/ComptonTelescope/online/src/online_coinc.cpp
@@ -67,7 +67,8 @@ int main(int argc, char** argv)
   auto deltaT = new TH1F("deltaT", "deltaT", timestampNBins, -timestampDiffSearch, timestampDiffSearch);
 
 #ifdef __USE_CUTG__
-  TFile* fcut = new TFile("/disk/proto-data/data/CUT_Compton.root");
+  //TFile* fcut = new TFile("/disk/proto-data/data/CUT_Compton.root");
+  TFile* fcut = new TFile("../data/CUT_Compton.root");
   TCutG* mcut = (TCutG*) fcut -> Get("CUT_Compton");
   fcut -> Close();
   cout << fcut << endl;
@@ -111,7 +112,8 @@ int main(int argc, char** argv)
   DecodeD* DD = new DecodeD(false); // Instantiates DecodeD object reading DSSSD(s) data flux
 //  newframe_t* event;
   //DD -> setTree("/disk/proto-data/data/20210304_run2/bb7_3309-7_cs137_20210304_14h35_conv.root");
-  DD -> setTree("/disk/proto-data/data/20210305_run3/bb7_3309-7_cs137_20210305_14h53_conv.root");
+  //DD -> setTree("/disk/proto-data/data/20210305_run3/bb7_3309-7_cs137_20210305_14h53_conv.root");
+  DD -> setTree("../data/20210210_run1/bb7_3309-7_cs137-20210210_11h05_coinc_run1_conv.root");
   int dlen = DD -> getLength();
 
   int i = 0;// ROSMAP files loop counter
@@ -124,7 +126,8 @@ int main(int argc, char** argv)
   ifstream iros, itrig;
   cout << "Loading data files " << std::flush;
 
-  itrig.open("/disk/proto-data/data/20210305_run3/mfm_trigger_20210305_run3.raw", ios::binary);
+  //itrig.open("/disk/proto-data/data/20210305_run3/mfm_trigger_20210305_run3.raw", ios::binary);
+  itrig.open("../data/20210210_run1/mfm_trigger_202102101104.raw", ios::binary);
   itrig.seekg(0, ios::end);
   int tlen = itrig.tellg();
   itrig.seekg(0, ios::beg);
@@ -133,7 +136,8 @@ int main(int argc, char** argv)
   itrig.close();
   cout << "... " << std::flush;
 
-  iros.open("/disk/proto-data/data/20210305_run3/mfm_rosmap_20210305_run3.raw", ios::binary);
+  //iros.open("/disk/proto-data/data/20210305_run3/mfm_rosmap_20210305_run3.raw", ios::binary);
+  iros.open("../data/20210210_run1/mfm_rdd_rosmap_04_mfm_rosmap_04_2021-02-10_10_04_59.raw.0001", ios::binary);
   iros.seekg(0, ios::end);
   int rlen = iros.tellg();
   iros.seekg(0, ios::beg);
diff --git a/Projects/ComptonTelescope/online/src/online_dsssd.cpp b/Projects/ComptonTelescope/online/src/online_dsssd.cpp
deleted file mode 100644
index ee694459a8825afb4b74120e9766c0961ed9e108..0000000000000000000000000000000000000000
--- a/Projects/ComptonTelescope/online/src/online_dsssd.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-// nptool headers
-#include "NPOptionManager.h"
-#include "RootOutput.h"
-#include "NPDetectorManager.h"
-#include "TComptonTelescopeData.h"
-#include "TComptonTelescopePhysics.h"
-
-// root headers
-#include "TFile.h"
-
-// custom headers
-#include "DecodeD.h"
-
-// C++ headers
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <cstdlib>
-using namespace std;
-
-//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//
-int main(int argc, char *argv[])
-{
-  ///////////////////////////////////////////////////////////////////////////
-  // configure option manager
-//   NPOptionManager::getInstance()->Destroy();
-
-  //string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction --circular";
-  string arg = "-D ./ComptonCAM.detector -C calibrations.txt -GH -E ./10He.reaction";
-  NPOptionManager::getInstance(arg);  
-
-  // open ROOT output file
-  RootOutput::getInstance("OnlineTree.root", "OnlineTree");
-  // get tree pointer
-  auto m_OutputTree = RootOutput::getInstance()->GetTree();
-
-  // configure detector manager
-  string detectorfileName = NPOptionManager::getInstance()->GetDetectorFile();
-  NPL::DetectorManager* m_NPDetectorManager = new NPL::DetectorManager();
-  m_NPDetectorManager->ReadConfigurationFile(detectorfileName);
-  m_NPDetectorManager->InitializeRootOutput();
-
-  // configure spectra server
-  m_NPDetectorManager->SetSpectraServer();
-
-  // instantiate raw ComptonCAM data pointer
-  auto ccamData = new TComptonTelescopeData();
-  // connect raw CCAM data pointer to physics class
-  auto ccamPhys = (TComptonTelescopePhysics*) m_NPDetectorManager->GetDetector("ComptonTelescope");
-  ccamPhys->SetRawDataPointer(ccamData);
-
-  // deal with file name and number of events to treat from command line
-  std::cout << "\n";
-  int nevents = -1;
-  string fileName = "bb7_3309-7_cs137_20210304_14h35_conv.root";
-  if (argc == 1) {
-     std::cout << "Name of file to analyse should be provided as a command line argument\n";
-     std::cout << "Default file " << fileName << " is considered\n";
-  }
-  else {
-     fileName = argv[1];
-     if (argc == 3) nevents = std::atoi(argv[2]);
-  }
-
-  // read data file/flux and fill ccamData object
-  std::cout << "Reading data from " << fileName << "\n";
-  DecodeD* DD = new DecodeD(true); // Instantiates DecodeD object reading DSSSD(s) data flux
-  newframe_t* event;
-  fileName = "../data/" + fileName;
-  DD -> setTree(fileName.c_str());
-//  DD -> setTree("../data/20200128_10h44_bi207_conv.root");
-//  DD -> setTree("../data/bb7_3309-7_cs137_20210304_14h35_conv.root");
-  //DD -> setTree("../data/bb7_3309-7_bi207_20210209_12h50_run10_conv.root");
-  int dlen = DD -> getLength();
-  // read a limited  number of events
-  if (nevents > 0) dlen = nevents;
-  std::cout << "Reading the first " << dlen << " entries\n";
-
-  while (DD -> getCursor() < dlen)
-  {
-    // cout number of entries treated
-    if (DD -> getCursor() % 10000 == 0) {
-      cout << "\rEntry " << DD -> getCursor();
-      cout << flush;
-    }
-
-    // Decode event
-    DD->Clear();
-    DD->decodeEvent();
-
-    // Clear raw and physics data
-    m_NPDetectorManager->ClearEventPhysics();
-    m_NPDetectorManager->ClearEventData();
-
-    // Fill data
-    //cout << "event size " << DD->getEventSize() << endl;      
-    for (int i = 0; i < DD->getEventSize(); i++) {
-      //cout << i << endl;
-      if (DD -> getFaceType(i) == 0) { // front
-        ccamData->SetFrontE(1, DD->getDetNbr(i)+1, DD->getStripNbr(i), DD->getEnergy(i));
-        ccamData->SetFrontT(1, DD->getDetNbr(i)+1, 33, DD->getTime());
-        //cout << "face " << DD -> getFaceType(i) << " det " << DD->getDetNbr(i) << " strip " << DD->getStripNbr(i) << " E " << DD->getEnergy(i) << " T " << DD->getTime() << endl;      
-      }
-      else if (DD -> getFaceType(i) == 1) { // back
-        ccamData->SetBackE(1, DD->getDetNbr(i)+1, DD->getStripNbr(i), DD->getEnergy(i));
-        ccamData->SetBackT(1, DD->getDetNbr(i)+1, 33, DD->getTime());
-        //cout << "face " << DD -> getFaceType(i) << " det " << DD->getDetNbr(i) << " strip " << DD->getStripNbr(i) << " E " << DD->getEnergy(i) << " T " << DD->getTime() << endl;      
-      }
-    }
-
-    // Build physical event
-    m_NPDetectorManager->BuildPhysicalEvent();
-
-    // Fill object in output ROOT file
-    m_OutputTree->Fill();
-
-    // check spectra
-    m_NPDetectorManager->CheckSpectraServer();
-  }
-
-  // fill spectra
-  m_NPDetectorManager -> WriteSpectra();
-
-
-  // Essential
-#if __cplusplus > 199711L && NPMULTITHREADING
-  m_NPDetectorManager->StopThread();
-#endif
-  RootOutput::Destroy();
-
-  return 0;
-}
-